-
Notifications
You must be signed in to change notification settings - Fork 91
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
Question: Is ThreadPoolExecutor
a known incompatible library?
#1102
Comments
Interesting... I haven't seen this yet, probably because nobody has used The behavior is strange though. So far, the problems usually appear as a faked file function trying to access a real file or vice verse, resulting in an exception, mostly |
If I find time this week, I could try to isolate this to an streamlined example. I guess this is further complicated by also using:
If I don't find time before the holidays, I'll at least point you to the project code:
Maybe I have some battle scars from my IoT days, but I suppose I could have some of these problematic tests write to actual disk. PITA I could probably work around for local testing, but shouldn't be an issue on the GitHub Action runners. |
Thank you! I'm also not sure when I will tackle this - I've a couple of other things in my queue, and there are the holidays of course. If you are doing more integrated tests, sometimes you can't get around using the real filesystem. A good compromise is to use a RAM disk as file system, if that is possible, that would cleaning it up easy. Anyway I'm interested to understand the problem, even if cannot be fixed easily - it sounds a bit wierd. |
I've had some issues with mixing I've thought about using a RAM disk or setting up a local container to run these in, but that's a lot of overhead and maintenance I'd like to try to avoid. The more steps I add to my setup process, the less likely folks will be willing to try to fork and contribute to the project. I'm sure I could find a way to streamline that, but the appeal to me to use Total props for maintaining this project btw, I've really enjoyed using it so far. |
Describe the bug
Not sure if this is a bug yet, as much as a sanity check/question. I recently started using the
ThreadPoolExecutor
context fromconcurrent.futures
to parallelize network requests.I've had tests running using
pyfakefs
for about a month or so now. As soon as I added the thread pool, some tests started taking a significant amount of time. I'm talking about from going from milliseconds to 30 seconds.I thought it was a deadlock at first but the tests always eventually resolve. There is also no such slow down outside of the testing environment. Although I haven't ruled everything out, if I disable
pyfakefs
, the issue disappears.I assume this is caused for much the same reasons why
subprocess
andmultiprocessing
have known compatibility issues. I mean we are talking threads and not processes, but they probably make similar low-level calls.So here's my question: is
concurrent.futures
another library with known compatibility issues? Should it be added to the documentation I linked to above? Does the same go for the older ThreadPool library?And is there a general recommendation for working around this kind of issue? I don't really want to disable the thread pool just for the tests and I also need
pyfakefs
to mock the file system.Let me know if you would like more context or details. All of this is in an open conda project so I can grab some GitHub Action logs if that would be useful. Thanks!
The text was updated successfully, but these errors were encountered: