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 data channel data races and globally shared plugin state #105

Open
wants to merge 2 commits into
base: mainline
Choose a base branch
from

Conversation

saligrama
Copy link

Issue:

Currently, the data channel has several concurrent goroutines that modify shared data. When running under the Go race detector go run -race, multiple warnings are fired about data races pertaining to the data channel. Moreover, the session registry holds one live instance of each session type (shell / port), meaning that when using the plugin as a library and trying to open multiple sessions at a time, these sessions overwrite each other's data.

Description of changes:

  • Add locking to the data channel and locking where shared data is modified
  • Modify the session registry to store constructors of session types, rather than live session instances.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

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.

1 participant