bravado
bravado copied to clipboard
Asynchronous client is not fork-safe
Client hangs if it is created and cached in the pre-fork phase of running of uwsgi. This only happens for Asynchronous client which uses twisted underneath. As per @bpicolo : "The twisted clients aren't fork safe because they open FDs, and won't ever be unless you all-in on twisted for your stack. Twisted has it's own way of forking."
A "valid solution" should be to fork before importing bravado.
But i think the intent is to have the bravado client creation pre-fork and cache it. How will that be achieved if importing bravado happens later.
Delaying import until post-fork is kinda fragile. It'd be nice if there were a reset() that can be invoked post-fork to clean up any file descriptors.