Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Call gevent.monkey.patch_all immediately on import
The api makes use of [gevent], a coroutine based networking library which relies heavily on monkey patching the stdlib. From the [gevent.monkey] docs: > Warning Patching too late can lead to unreliable behaviour > (for example, some modules may still use blocking sockets) or even errors. This appears to have happened here. Thanks to @allwyn-pradip for pointing me at the right file in PR linkedin#690. Resolves linkedin#686, linkedin#699, linkedin#644. Blog on gevent: https://eng.lyft.com/what-the-heck-is-gevent-4e87db98a8 > In the case of gevent — monkey patching has to be the absolute first thing a process does [gevent]: https://www.gevent.org/index.html [gevent.monkey]: https://www.gevent.org/api/gevent.monkey.html
- Loading branch information