-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix quit on ctrlc, race panic, atomic load align in session IO #11112
Merged
Conversation
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 was
linked to
issues
Mar 14, 2022
It doesn't look like |
@rosstimothy I wasn't able to trigger the race condition that was potentially possible due to tight tolerances or some other reason like optimization but I've added tests for CTRLC capture and atomic alignment. Please have another look |
zmb3
reviewed
Mar 14, 2022
zmb3
approved these changes
Mar 14, 2022
rosstimothy
approved these changes
Mar 15, 2022
xacrimon
added a commit
that referenced
this pull request
Mar 16, 2022
xacrimon
added a commit
that referenced
this pull request
Mar 16, 2022
Closed
Closed
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
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.
lib/srv/termmanager.go
is responsible for dealing with most session IO and handles behaviours like multiplexing. This PR fixes the following bugs:This PR does remove some usage of atomics in termmanager and instead locks additional fields under the mutex. I didn't observe any noticable performance drop here and this would only become a problem if you had hundreds of users typing in a session at the same time. This makes the code somewhat easier to reason about but we'll have to look into that again if it becomes a problem at some point in the future.