Fix system.stack_trace when running in daemon mode#17630
Fix system.stack_trace when running in daemon mode#17630alexey-milovidov merged 17 commits intoClickHouse:masterfrom
Conversation
alexey-milovidov
left a comment
There was a problem hiding this comment.
Also we can add a test after this fix.
|
Simply revert this commit: bdefa92 |
|
We also need something to suppress TSan. |
|
We failed to suppress TSan on function level, now let's do it on target level:
|
4655a3c to
9127ab9
Compare
|
Sandbox error:
Will try again... |
8239df1 to
04128c3
Compare
|
Did not help again... maybe I will try to do some magic. I really need this PR to be merged :) |
|
Cannot reproduce TSan report on my machine... |
|
Reproduced. |
|
Fixed. |
|
Not fixed? |
|
@amosbird I just read what TSan said. First it said that we can read stack_trace variable while it's being written by the signal handler.
So, TSan was right and I protected from this case with Then TSan said that we can write to stack_trace variable from concurrent invocations of signal handlers. I protected from it with PS. It's too complex for the two reasons:
The latter is not necessarily - what if don't use global variables and simply pass all data via pipe? The only difficulty is that we read from pipe with timeout, so we have to implement ReadBufferFromFileDescriptorWithTimeout. |
|
I don't understand why changing |
I'm only about races on |
Backport #17630 to 20.12: Fix system.stack_trace when running in daemon mode
Backport #17630 to 20.11: Fix system.stack_trace when running in daemon mode
Backport #17630 to 20.10: Fix system.stack_trace when running in daemon mode
Backport #17630 to 20.8: Fix system.stack_trace when running in daemon mode
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix empty
system.stack_tracetable when server is running in daemon mode.Detailed description / Documentation draft:
None.