-
Notifications
You must be signed in to change notification settings - Fork 29
Fix crash when channel is removed but _notify_queue still has events #100
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -301,9 +301,11 @@ def main(workers=None, handle_signals=True): | |
on_exit.callback(lambda: restore_signal_handlers()) | ||
|
||
# Start notification handling thread | ||
_notify_queue_shutdown.clear() | ||
t = threading.Thread(target=_notify_loop) | ||
t.daemon = True | ||
t.start() | ||
on_exit.callback(_notify_queue_shutdown.set) | ||
on_exit.callback(_notify_queue.put, None, block=True, timeout=5) | ||
|
||
on_exit.callback(lambda: fuse_session_reset(session)) | ||
|
@@ -313,6 +315,7 @@ def main(workers=None, handle_signals=True): | |
session_loop_single() | ||
else: | ||
session_loop_mt(workers) | ||
t.join() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be a good idea to leave a comment here (in the code) on why this is needed, or someone may remove this again at some point as "not needed". |
||
|
||
if exc_info: | ||
# Re-raise expression from request handler | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -267,7 +267,11 @@ def _notify_loop(): | |
while True: | ||
req = _notify_queue.get() | ||
if req is None: | ||
return | ||
break | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this change has any semantic effect...? |
||
|
||
if _notify_queue_shutdown.is_set(): | ||
# Just drain the queue | ||
continue | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not break/return? |
||
|
||
if req.kind == NOTIFY_INVAL_INODE: | ||
if req.attr_only: | ||
|
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.
Why do we need this in addition to the sentinel object? And if the sentinel method doesn't work, shouldn't we replace it with the Event instead of doing both?