-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Instantiating multiprocessing.SimpleQueue() from an imported package fails unless SimpleQueue() is instantiated inside Twisted application first #12178
Comments
Thanks for the report. I don't see how this is related to twisted. I don't see any twisted code in the traceback. From what I can see, this is about mac-notifications and that project don't use Twisted. Can you please share an self-contained example that replicate this error Note that if you are using threads in your Twisted code, those thread should be handled only via Twisted helper API. You should not mix Twited code and threading code without using the Twisted helping API. I am closing this. Without being able to reproduce this error, it is very hard to fix this. If you have a fix for this, please submit a pull request and I we can reopen this ticket. Regards |
As I said in the bug report all I did was call
thanks, i suspect it is related to this, but the code never gets to the thread instantiation. it dies on literally the first line of |
I think there might be more to discuss here. The fact that this is related to I am not reopening right away because this really needs a clear reproducer to be actionable enough to be more than a vague "uhhh, maybe, global state, handwave handwave processes, file descriptors" magnet for anxiety or FUD :). But if someone can do that so we can figure out what, if anything, we are having issues with, that would be great. |
i think i can create a reproducible example relatively easily; i will try to do so. |
and fwiw that was my general impression as well. |
ps i did find a very old issue over in the |
Easily reproducible on macOS:
|
I updated the issue description with the full stack trace instead of just the fragment i had put initially. |
I am reopening this. I don't have a macOS VM at hand to try to reproduce this... but I guess that there is enought information here to reproduce it. It would be awesome to have this error reproduced via GitHub Actions |
Describe the incorrect behavior you saw
See discussion. Ran into a weird situation where I was importing a package
macos_notifications
. That package in turn instantiates amultiprocessing.SimpleQueue
object - or at least it tries to. Just the simple instantiation call fails with abad value(s) in fds_to_keep
error......unless, I discovered, I instantiate a
SimpleQueue
object inside my Twisted application somewhere, anywhere. Then there's no error and things more or less work fine albeit with warnings about uncollected resources when the Twisted server exits:Describe how to cause this behavior
See exact steps below
Inside of a
twisted.application
(specifically opencanary) running some twisted servers (bothinternet.TCPServer
andinternet.UDPServer
, roughly 10 at the same time) do:I would presume the same error might arise from other packages that choose to instantiate a
SimpleQueue()
butmacos_notifications
is the only one I tested.Stack trace
Describe the correct behavior you'd like to see
I shouldn't need to instantiate
SimpleQueue()
to getSimpleQueue()
to work in packages used by my twisted app.Testing environment
pip freeze
:Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: