-
Notifications
You must be signed in to change notification settings - Fork 320
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
ubuntu-22.04 fix: NoneType object has no attribute getcurrent() #954
Open
farshan-dev
wants to merge
1
commit into
eventlet:master
Choose a base branch
from
farshan-dev:fix-953
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What do you think of making
id(gr)
the default return value rather than try/except/if/else?Calling
id(None)
seems to always return something so... why not.The idea behind these changes LGTM, I'd just suggest to refactor the logic to reduce the complexity of this function. Don't want to pick nit neither. Let me know if that sounds good for you.
https://docs.python.org/3/library/functions.html#id
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.
On the other hand I wonder if by forcing the return an identifier even when
gr
is equal toNone
we could may find us hidding these symptoms. Symptoms which may be the manifestation of a more pernicious problem.Please can you give us more details about the context where you face this problem?
Do you have a reproducer?
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.
if
greenlet.getcurrent
doesn't exist and ifgr
is equal toNone
seems weird.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.
That's more or less the scenario you propose to follow.
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.
As this eventlet module (
eventlet.green.thread
) is the patched version of the Python thread module I'd argue that maybe, one option, could be to return the result of the nativeget_ident
function. It will return the ‘thread identifier’ of the current thread. IMO, That would more meaningful that returning an integer computed from a None value.https://docs.python.org/3/library/threading.html#threading.get_ident
But I still continue to think that the observed behavior is the symptom of a problem more deeply rooted.
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.
thank you for your review, after searching for root of this problem, I found its not related to this package, and its about bobcat keystone package that uses this package. and I tried to fix actual problem and eventlet package works fine.
for reproduce this package install openstack prereqs and set bobcat, then install keystone, and run su -s /bin/sh -c "keystone-manage db_sync", in ubuntu 22.04, you can see error.
thank you again 🙌
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 your feedback. So, if you agree with abandoning this proposal I think we can close this github pull request and its associated github issue. Do you agree?