-
Notifications
You must be signed in to change notification settings - Fork 171
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
DIRAC_USE_TORNADO_IOLOOP set after Refresher is imported in tornado_start_all #5223
Comments
There are two places where this variable is read, can they be converted to read later than import time? DIRAC/src/DIRAC/FrameworkSystem/Client/MonitoringClient.py Lines 89 to 94 in 54d8988
This is only used in DIRAC/src/DIRAC/ConfigurationSystem/private/Refresher.py Lines 110 to 115 in 8269146
This one looks a little tricker. |
I knew this would bite us https://github.com/DIRACGrid/DIRAC/pull/4865/files#r557381856 Again: why not putting the variable definition at the very top of the file and be done with it ? |
As all modules containing a |
Ah true... I guess it is due to this check that all the scripts use DIRAC/src/DIRAC/Core/Utilities/DIRACScript.py Lines 53 to 59 in cf55bc4
I'd be tempted to remove that check actually, and relying on the name... Importing hundreds of module every time we call a script is an overkill anyway isn't it ? Another option would be to have that variable set in the Or, would by any chance adding the following at the very top of
|
It can also be added to the DIRAC/src/DIRAC/FrameworkSystem/Client/ComponentInstaller.py Lines 2357 to 2367 in 9515f7e
(for |
Yes, that's what I proposed (it's the
My choice goes to if __name__ == "__main__":
import os
os.environ['DIRAC_USE_TORNADO_IOLOOP'] = 'Yes' I think it's the best solution |
When using entrypoints that will never trigger as |
argh, yeah.... oh my... |
Yeah...to stay safe shall we make the script exit with an error if the environment is invalid? |
that is exactly what I have done. PR coming :) |
In
tornado_start_all.py
DIRAC_USE_TORNADO_IOLOOP
is set in themain
function but theDIRACScript
import triggersDIRAC.ConfigurationSystem.private.Refresher
to be imported which reads this variable at import time.Originally posted by @chrisburr in #5214 (comment)
The text was updated successfully, but these errors were encountered: