-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
unregister onExit event handler on disposing interactive host #24058
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
4d9717f
unregister onExit event handler on disposing interactive host
ivanbasov d67d272
code review feedback
ivanbasov 0262e8b
fixing incomplete commit
ivanbasov cb57d2d
code review feedback
ivanbasov a3fce2b
code review feedback
ivanbasov e625b6d
code review feedback
ivanbasov 91a8810
code review feedback
ivanbasov bb185c7
code review feedback
ivanbasov 740a696
rebase
ivanbasov 2977818
experiment #1
ivanbasov eb87327
experiment #2
ivanbasov 30bd67e
experiment #3
ivanbasov e299bf8
Experiment #4
ivanbasov 9abe607
semaphore init corrected
ivanbasov ac9e071
resolving a deadlock
ivanbasov 68dfd2d
feedback
ivanbasov 49f7bf1
feedback
ivanbasov 2243d2a
comment correction
ivanbasov 5650219
code review feedback
ivanbasov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
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
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
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.
Is the problem here that this can deadlock because if the _host.OnProcessExited() call is happening above and that's still holding the lock, and it tries to call back into Dispose(), that will deadlock? Why can't we call _host.OnProcessExited() outside the lock?
I guess a better comment here would be appreciated. The use of
volatile
here is generally scary. I think it works, but that doesn't make it less scary. #ResolvedThere 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.
(this question is best answered by just adding more comments so the code is clearer vs. answering my question in GitHub) #Resolved
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, Jason! I added more comments to clarify the scenario.
Maybe there can be an option to avoid using volatile and removing the _host.OnProcessExited() outside of the lock. We could not see these options so far. The problem we fixed that the host is being disposed during _host.OnProcessExited() execution. So, the fix is to protect it from the dispose.
In reply to: 163994639 [](ancestors = 163994639)