Skip to content
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

bridge: fix multiple close in fswatch1 #20634

Conversation

allisonkarlitskaya
Copy link
Member

We call self._watch.close() and then set self._watch = None which means that if the function gets called twice we crash. Those crashes have been showing up with increasing frequency in cockpit-files, so let's fix them.

Proper type annotations on this class would have forbidden this code in the first place, so let's add them now.

I've known about this issue for a while but I've put off fixing it because we should probably sort out why .do_close() gets called twice in the first place. Let's fix this anyway, though, since it's causing annoying failures in the meantime.

We call `self._watch.close()` and then set `self._watch = None` which
means that if the function gets called twice we crash.  Those crashes
have been showing up with increasing frequency in cockpit-files, so
let's fix them.

Proper type annotations on this class would have forbidden this code in
the first place, so let's add them now.

I've known about this issue for a while but I've put off fixing it
because we should probably sort out why .do_close() gets called twice in
the first place.  Let's fix this anyway, though, since it's causing
annoying failures in the meantime.
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@allisonkarlitskaya allisonkarlitskaya merged commit e79488d into cockpit-project:main Jun 20, 2024
81 of 83 checks passed
@allisonkarlitskaya allisonkarlitskaya deleted the watch-close-multiple branch June 20, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants