Closed nickryand closed 1 year ago
For the most part ProcessPoolExecutor
is caveat emptor as passing python objects around between processes can be tricky and a lot of times the stuff that gets run into can't be addressed by requests_futures (as it's actually problems with underlying libraries.)
My only thought would be to add some debugging prints in get_translation
to see if it's even getting called. It's possible requests session hooks don't make it over into the other process correctly.
I think I have tracked this down to behavior with pickle. Pickle calls a couple of methods dealing with getting and setting state during the marshal and unmarshal process. My guess is requests Response object does not handle that use case.
I'll dig more. I don't know if there is a good fix for this if you are trying to keep support for older versions of python.
Ah, yeah that's exactly the sort of problem that's been run into a number of times over the years. It'd require requests
fixing it as I don't really have the ability to make its objects pickle-able w/o some really nasty monkey patching that I wouldn't even consider doing.
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.
I have not been able to debug deep into this yet but I wanted to drop it here so other people may see the same issue.
I took your example from #105 and set the executor to ProcessPoolExecutor
The result is:
ThreadPoolExecutor works without issue.