You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Windows can't fork to create new processes, and it must use spawn, global variables such as config are not being copied to child processes. We should find a way to work around this, otherwise config basically becomes a constant, and that's not the expected behaviour.
Maybe we should pass it as an extra attribute to AgentProcess and NameserverProcess?
The text was updated successfully, but these errors were encountered:
I have been playing around with this, with variable amounts of success.
I got the test_agent_bind_transport_global to work by passing the config as a parameter to the Agent constructor, and then using it to set the global variable inside __init__.
The linger test, though, I couldn't get to pass, and I'm still not sure why. One thing I noticed about the other one was that, when launching a windows process, __init__.py is executed again (which doesn't happen after a fork), and that overrides the config dictionary, so that's something to keep in mind.
In the end, I'm thinking the issue has something to do with the way and, specifically, the order in which python imports different modules, because even though Agent.close_all() and get_linger() are executed in the same process, they read different values for config['LINGER'], which is what eventually makes the thing fail.
All the progress (mostly hacks) I've made is saved in my config branch.
Related to #255
Since Windows can't
fork
to create new processes, and it must usespawn
, global variables such asconfig
are not being copied to child processes. We should find a way to work around this, otherwiseconfig
basically becomes a constant, and that's not the expected behaviour.Maybe we should pass it as an extra attribute to
AgentProcess
andNameserverProcess
?The text was updated successfully, but these errors were encountered: