Fix lifetime of callback in threadPoolCallbackRunner#74267
Fix lifetime of callback in threadPoolCallbackRunner#74267CurtizJ merged 2 commits intoClickHouse:masterfrom
threadPoolCallbackRunner#74267Conversation
|
This is an automated comment for commit ec23f7f with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page
Successful checks
|
antonio2368
left a comment
There was a problem hiding this comment.
Do you have an example of failure which is fixed by this?
IMO the point of ThreadPoolCallbackRunnerLocal is to be local so it should be also in some limited scope and with that should be destructed with it's callback after tasks are executed.
|
I assume it's related to this #74287 |
|
Yes, it is related to #74287. Currently, the following execution sequence may happen: It happens because the task function is moved to the thread pool, and its lifetime can extend the local runner's lifetime. I think this is wrong in general and may be dangerous. In #74287, we are waiting for the parallel removal of parts. The vector of parts is held by lambda, and when it is destroyed, we can already return from |
|
Failed integration tests are flaky in master. |
Changelog category (leave one):
Fixes #74287.
CI Settings (Only check the boxes if you know what you are doing)
All builds in Builds_1 and Builds_2 stages are always mandatory
and will run independently of the checks below: