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 non-synchronized access to handlers map #629

Merged
merged 1 commit into from
Jan 16, 2021

Conversation

viliam-durina
Copy link
Contributor

The user modifies the handlers map from his thread. However, when a
signal is raised, it's on another thread: on Windows it's
WindowsStreamPump. Therefore this map is accessed from 2 threads
without synchronization.

The error manifests as handler not being called. For unknown reason, we
only observed it on Windows, but it seems the issue also affects Linux
terminals.

The user modifies the `handlers` map from his thread. However, when a
signal is raised, it's on another thread: on Windows it's
`WindowsStreamPump`. Therefore this map is accessed from 2 threads
without synchronization.

The error manifests as handler not being called. For unknown reason, we
only observed it on Windows, but it seems the issue also affects Linux
terminals.
viliam-durina added a commit to cangencer/hazelcast-jet that referenced this pull request Dec 21, 2020
@mattirn mattirn force-pushed the master branch 2 times, most recently from 415aba8 to e1c75ce Compare December 27, 2020 16:19
ufukyilmaz pushed a commit to hazelcast/hazelcast-jet that referenced this pull request Dec 30, 2020
* Use JLine to read sql lines

* Add basic multiline support

* Add a way to cancel a streaming query

* Add SQL CLI documentation

* Workaround the jline race in signal handlers

See jline/jline3#629

* Allow special commands to run without semicolon

Co-authored-by: Ufuk <[email protected]>
Co-authored-by: Viliam Durina <[email protected]>
Co-authored-by: Marko Topolnik <[email protected]>
viliam-durina added a commit to gierlachg/hazelcast-jet that referenced this pull request Jan 7, 2021
* Use JLine to read sql lines

* Add basic multiline support

* Add a way to cancel a streaming query

* Add SQL CLI documentation

* Workaround the jline race in signal handlers

See jline/jline3#629

* Allow special commands to run without semicolon

Co-authored-by: Ufuk <[email protected]>
Co-authored-by: Viliam Durina <[email protected]>
Co-authored-by: Marko Topolnik <[email protected]>
@mattirn mattirn force-pushed the master branch 2 times, most recently from 8e035a1 to 2c53681 Compare January 10, 2021 16:13
@viliam-durina
Copy link
Contributor Author

bump

@mattirn mattirn added this to the 3.18.1 milestone Jan 16, 2021
@mattirn mattirn merged commit ac4cdc1 into jline:master Jan 16, 2021
@mattirn mattirn mentioned this pull request Jan 17, 2021
@viliam-durina viliam-durina deleted the concurrency-fix branch January 18, 2021 07:27
@viliam-durina viliam-durina restored the concurrency-fix branch November 5, 2021 20:39
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