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

Fix cleaning up switch on error on Windows #5351

Closed
wants to merge 1 commit into from

Conversation

dra27
Copy link
Member

@dra27 dra27 commented Nov 14, 2022

If switch creation fails and the user elects to clean-up the switch, there is at present an error message displayed when the switch is erased. This is caused by the write lock on the switch still being held. The fix is to drop the switch lock prior to deletion - the global lock is still held.

Switch lock needs to be dropped prior to erasing the switch on Windows.
Copy link
Collaborator

@rjbou rjbou left a comment

Choose a reason for hiding this comment

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

Maybe worth adding a comment on why this is done this way (switch lock released before cleaning). otherwise lgtm

@dra27
Copy link
Member Author

dra27 commented Nov 21, 2022

TODO note - it's possible that this can be done while taking the write lock, but using O_SHARE_DELETE to permit the file to be removed, even though it's still open (@dra27 will check).

@rjbou rjbou added the PR: WIP Not for merge at this stage label Nov 22, 2022
@rjbou rjbou self-requested a review November 22, 2022 13:52
@dra27
Copy link
Member Author

dra27 commented Feb 6, 2023

The approach in #5435 is better than this one (since the lock is then held right up to the deletion)

@dra27 dra27 closed this Feb 6, 2023
@dra27 dra27 deleted the switch-locking-error branch February 6, 2023 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: WIP Not for merge at this stage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants