-
Notifications
You must be signed in to change notification settings - Fork 45
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
Fix check uwsgi options #148
Conversation
Can you say a bit more about how you discovered this behavior? The uwsgi documentation indeed doesn't seem to say anything at all about a circumstance in which uwsgi would be present but uwsgi.opt wouldn't, and I haven't found anything in the uwsgi release notes to indicate when (or why) this behavior changed. I don't see any harm in adding this extra check, since we don't want to throw an error due to uwsgi.opt being missing if it is missing, but I'd like to understand what this would actually mean. |
Even if uwsgi is avaiable in sys.modules, you need to check if uwsgi.opt is available. This code was broken in latest version of uwsgi when running a process without uwsgi. The uwsgi documentation unfortunately is not clear about this https://uwsgi-docs.readthedocs.io/en/latest/PythonModule.html Also the link for LaunchDarkly documentation is broken.
@eli-darkly thanks for your prompt feedback. I also don't understand from uWSGI documentation unfortunately. We detected this issue running LaunchDarkly under RQ. For the sake of checking if this is the "normal" behaviour, I created a simple http server that runs with and without uWSGI and tried to use the ld client and import uWSGI, and when it doesn't run under uWSGI the import fails as the documentation say: https://github.com/andrefreitas/test-uwsgi
I don't like not understanding why rq changes this, but I also see that adding this extra check doesn't produce any harm, so I am fine with the tradeoff of not understanding fully at this moment the root cause. So are you fine in proceeding like this? |
@andrefreitas Yes, I agree that there's no harm in the extra check. I was just hoping to be able to write a release note that was a little more specific about what circumstances this might apply to, but I guess the note will have to be somewhat vague. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching and addressing these issues.
We've released version 7.0.1 which includes this fix. |
@eli-darkly me and the Beyond Pricing engineering team appreciate your collaboration. Thanks 🙏 |
use Releaser v2 config
Even if uwsgi is avaiable in sys.modules, you need to check if uwsgi.opt is available. This code was broken in latest version of uwsgi when running a process without uwsgi. The uwsgi documentation unfortunately is not clear about this https://uwsgi-docs.readthedocs.io/en/latest/PythonModule.html
Also the link for LaunchDarkly documentation is broken.