Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ldclient.get() call is getting hanged (time out) on updating requests version to 2.18.4 from 2.12.5 #86

Closed
akash-gautam opened this issue May 29, 2018 · 3 comments

Comments

@akash-gautam
Copy link

Description: The ldclient.get() call is getting timed out in my service on updating the requests version from 2.12.5 to 2.18.4 . On probing further I found out that the ldclient.get() method calls LDClient (in client.py file) and LDClient calls self._update_processor.start() this is the call which is actually getting timed out. If I comment out the self._update_processor.start() call then the ldclient.get() runs fine. One more thing is that ldclient has a requirement requests>=2.17.3 but still it seems to be working with the lower version. I tried with the updated versions of ldclient as well but got the same behaviour.

Env details:
Python: 2.7
LDClient: 5.0.4
Requests: 2.18.4
Ubuntu:14.04

@eli-darkly
Copy link
Contributor

Hmm. So far, I haven't been able to reproduce this with those versions of LDClient and Requests (although I'm running on MacOS rather than Ubuntu). And since that is the latest release of Requests, I assume that combination has been used pretty commonly in the field, so I'm guessing there may be some other variable in the environment that we haven't identified yet.

Could you clarify two things for me: 1. Are you using streaming or polling mode? 2. When you say "self._update_processor.start() ... is the call which is actually getting timed out", do you mean that that method call itself is not returning? Or is it the subsequent call "update_processor_ready.wait(start_wait)"? The reason I ask is that start() does nothing more than start a thread, so I would not expect it to block under any circumstances. One way to know for sure would be to see whether the message "Waiting up to ___ seconds for LaunchDarkly client to initialize" appears in your log or not.

@akash-gautam
Copy link
Author

akash-gautam commented May 30, 2018

Thanks for your time Eli. I am using streaming mode(stream=True), self._update_processor is actually getting timed out, self._update_processor call the run method of StreamingUpdateProcessor class (in streaming.py file), which in turn makes series of calls like _connect followed by SSEClient wherein it calls _connect method where I observe that call to self.resp.iter_content(chunk_size=self._chunk_size, decode_unicode=True) seems to be hanging. When I comment it out this line things work as expected.

Note, that the chunk_size is 10000 and decode_unicode is set as True.

eli-darkly added a commit that referenced this issue Jan 31, 2019
@eli-darkly
Copy link
Contributor

Closing this because our SDK doesn't use the requests package any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants