Fix assert in SpanHolder::finish() with fibers attempt 2#50034
Merged
Avogar merged 5 commits intoClickHouse:masterfrom May 30, 2023
Merged
Fix assert in SpanHolder::finish() with fibers attempt 2#50034Avogar merged 5 commits intoClickHouse:masterfrom
Avogar merged 5 commits intoClickHouse:masterfrom
Conversation
Contributor
|
This is an automated comment for commit 2541ad6 with description of existing statuses. It's updated for the latest CI running
|
Avogar
commented
May 19, 2023
src/Common/AsyncTaskExecutor.h
Outdated
Member
Author
There was a problem hiding this comment.
This implementation from previous fix is not good for 2 reasons:
- It works only when fibers are executed in one thread. But sometimes it can happen that fiber was started in one thread, suspended and resumed in another thread (for example during query cancellation).
- It doesn't clean instance created for fiber when fiber is destroyed, so map can become really big (I just didn't think about it, my fault).
| if (!ptr) | ||
| ptr = std::make_unique<DataWrapperImpl>(); | ||
|
|
||
| return dynamic_cast<DataWrapperImpl *>(ptr.get())->impl; |
Member
There was a problem hiding this comment.
I think we can do static_cast here?
Member
Author
There was a problem hiding this comment.
Sure, I will add it in the next PR.
| return dynamic_cast<DataWrapperImpl *>(ptr.get())->impl; | ||
| } | ||
|
|
||
| T main_instance; |
Member
There was a problem hiding this comment.
Make it std::optional or unique_ptr maybe
Member
Author
There was a problem hiding this comment.
Sure, I will add it in the next PR.
KochetovNicolai
approved these changes
May 30, 2023
robot-clickhouse
added a commit
that referenced
this pull request
May 30, 2023
Avogar
added a commit
that referenced
this pull request
May 31, 2023
Backport #50034 to 23.4: Fix assert in SpanHolder::finish() with fibers attempt 2
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.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix assert in SpanHolder::finish() with fibers. Closes #49185.
Documentation entry for user-facing changes