Repository navigation
Fix data races between terminals in different threads of one process - #53
Closed
alexey-milovidov wants to merge 3 commits into
Closed
alexey-milovidov wants to merge 3 commits into
alexey-milovidov wants to merge 3 commits into
Conversation
The incremental history search had its own handling of Ctrl-Z with `raise( SIGSTOP )`, bypassing the key binding. When an application rebinds Ctrl-Z to disable suspending (e.g. when the line editor runs inside a server process serving a pseudoterminal), the search still stopped the process. Now Ctrl-Z leaves the search and is passed to the main loop, like other editing keys, so that it goes through the key binding. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ClickHouse runs several embedded clients concurrently in the server (SSH and the Web Terminal), each with its own `Replxx` and `Terminal`. ThreadSanitizer found data races on the process-wide state: - `_terminal_`, written by `enable_raw_mode` and `disable_raw_mode`; it is atomic now; - the partial UTF-8 sequence in `read_unicode_character`; it is thread-local now; - the buffer returned by `ansi_color`; it is thread-local now. Co-Authored-By: Claude Opus 5.5 <[email protected]>
alexey-milovidov
added a commit
to ClickHouse/ClickHouse
that referenced
this pull request
Oct 16, 2026
The Stress test with TSan found data races in `replxx` between the embedded clients of SSH and the Web Terminal running concurrently: on `_terminal_` in `Terminal::enable_raw_mode` and on the static UTF-8 state of `read_unicode_character`. They are now atomic and thread-local; the buffer of `ansi_color` is thread-local as well. ClickHouse/replxx#53 https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=125517&sha=821f784ae6cfa635a3bf0e0d8ce486711e69cd53&name_0=PR&name_1=Stress%20test%20%28arm_tsan%29 https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=125517&sha=821f784ae6cfa635a3bf0e0d8ce486711e69cd53&name_0=PR&name_1=Stress%20test%20%28amd_tsan%29 PR: #125517 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in 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.
ClickHouse runs several embedded clients concurrently in the server (SSH and the Web Terminal), each with its own
ReplxxandTerminal. ThreadSanitizer in the Stress test found data races on the process-wide state:_terminal_, written byenable_raw_modeanddisable_raw_mode: it is atomic now;read_unicode_character: it is thread-local now;ansi_color: it is thread-local now.The branch is based on 00cd994 (
clickhouse/no-suspend-in-history-search), the commit ClickHousemastercurrently uses, so this PR also shows that commit.Related: ClickHouse/ClickHouse#125517
CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=125517&sha=821f784ae6cfa635a3bf0e0d8ce486711e69cd53&name_0=PR&name_1=Stress%20test%20%28arm_tsan%29
🤖 Generated with Claude Code