devcyclehq / python-server-sdk Goto Github PK
View Code? Open in Web Editor NEWDevCycle - Python Server SDK
Home Page: https://docs.devcycle.com/
License: MIT License
DevCycle - Python Server SDK
Home Page: https://docs.devcycle.com/
License: MIT License
I got this error in the logs after I lost connectivity in my dev computer. The page I was loading that was requesting the feature flag just hanged. This could be a serious issue if the SDK loses connectivity with DevCycle in a production environment.
It should return the default value if it cannot evaluate the variable in a relatively short amount of time.
Hi I am using Django and I followed the setup instructions you provided in your documentation.
When working locally everything seems to work fine, however when the app is deployed I am experiencing instability when using the DevCycle SDK. (10-20% of the time)
My guess is that this is related to the pool_manager
in urllib3
.
I found a related ticket in urllib3
psf/requests#4937
It seems that implementing a single retry works for most people.
Could it be a throttling mechanism on your side? API rate?
Any help would be appreciated thanks.
Here is my startup command.
gunicorn --bind 0.0.0.0:9000 core.asgi:application -w 4 -k uvicorn.workers.UvicornWorker
name = "devcycle-python-server-sdk"
version = "1.2.2"
name = "urllib3"
version = "1.26.16"
name = "django"
version = "4.2.1"
name = "gunicorn"
version = "20.1.0"
name = "uvicorn"
version = "0.22.0"
Traceback (most recent call last):
File "/opt/pysetup/.venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/opt/pysetup/.venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 449, in _make_request
six.raise_from(e, None)
File "<string>", line 3, in raise_from
File "/opt/pysetup/.venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 444, in _make_request
httplib_response = conn.getresponse()
File "/usr/local/lib/python3.8/http/client.py", line 1348, in getresponse
response.begin()
File "/usr/local/lib/python3.8/http/client.py", line 316, in begin
version, status, reason = self._read_status()
File "/usr/local/lib/python3.8/http/client.py", line 277, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/local/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "/usr/local/lib/python3.8/ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)File "/usr/local/lib/python3.8/ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
ConnectionResetError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/src/core/flags/sdk/client.py", line 21, in get_dvc_variables
variables = client.all_variables(user_data)
File "/opt/pysetup/.venv/lib/python3.8/site-packages/devcycle_python_sdk/api/dvc_client.py", line 291, in all_variables
(data) = self.all_variables_with_http_info(user, **kwargs) # noqa: E501
File "/opt/pysetup/.venv/lib/python3.8/site-packages/devcycle_python_sdk/api/dvc_client.py", line 355, in all_variables_with_http_info
return self.api_client.call_api(
File "/opt/pysetup/.venv/lib/python3.8/site-packages/devcycle_python_sdk/api_client.py", line 316, in call_api
return self.__call_api(resource_path, method,
File "/opt/pysetup/.venv/lib/python3.8/site-packages/devcycle_python_sdk/api_client.py", line 148, in __call_api
response_data = self.request(
File "/opt/pysetup/.venv/lib/python3.8/site-packages/devcycle_python_sdk/api_client.py", line 358, in request
return self.rest_client.POST(url,
File "/opt/pysetup/.venv/lib/python3.8/site-packages/devcycle_python_sdk/rest.py", line 268, in POST
return self.request("POST", url,
File "/opt/pysetup/.venv/lib/python3.8/site-packages/devcycle_python_sdk/rest.py", line 161, in request
r = self.pool_manager.request(
File "/opt/pysetup/.venv/lib/python3.8/site-packages/urllib3/request.py", line 78, in request
return self.request_encode_body(
File "/opt/pysetup/.venv/lib/python3.8/site-packages/urllib3/request.py", line 170, in request_encode_body
return self.urlopen(method, url, **extra_kw)
File "/opt/pysetup/.venv/lib/python3.8/site-packages/urllib3/poolmanager.py", line 376, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "/opt/pysetup/.venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 787, in urlopen
retries = retries.increment(
File "/opt/pysetup/.venv/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/opt/pysetup/.venv/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise
raise value.with_traceback(tb)
File "/opt/pysetup/.venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/opt/pysetup/.venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 449, in _make_request
six.raise_from(e, None)
File "<string>", line 3, in raise_from
File "/opt/pysetup/.venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 444, in _make_request
httplib_response = conn.getresponse()
File "/usr/local/lib/python3.8/http/client.py", line 1348, in getresponse
response.begin()
File "/usr/local/lib/python3.8/http/client.py", line 316, in begin
version, status, reason = self._read_status()
File "/usr/local/lib/python3.8/http/client.py", line 277, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/local/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "/usr/local/lib/python3.8/ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "/usr/local/lib/python3.8/ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
It is difficult to know with what python versions I can use this library and I am not seeing any build for different versions.
We purchased your product and wanted to integrate this library in our back-end.
Hi! I'm working on getting the first stable release of the OpenFeature Python SDK out. I also have a project that uses DevCycle for powering its feature flags. I would like to use it as guinea pig to make sure the solution works end-to-end.
If you are interested in writing an OpenFeature provider, I can offer help with reviewing the code and beta testing it.
Hi, congrats on the new release! I noticed that the code contains annotations but mypy is not picking them because the package lacks a py.typed marker.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.