Skip to content

Conversation

@morningman
Copy link
Contributor

@morningman morningman commented Dec 14, 2020

Proposed changes

Introduced by PR #5051.
As @liutang123 said, when PlanFragmentExecutor is destructed, it will call
close -> ExecNode::close -> OlapScanNode::close. OlapScanNode will wait for _transfer_thread.
_transfer_thread will wait for all OlapScanner processing to complete.
OlapScanner is processed by the scanner thread. When the last scanner processing is completed,
_transfer_thread will break out of the loop, and PlanFragmentExecutor will continue to destruct.
And if it is completed, its RuntimeProfile::Counter will also be destructed.
At this time, the ScopedTimer in the Scan thread may still use this Counter when it is destructed.

So we must make sure that the timer is deconstructed before deconstructing the runtime profile.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)

@morningman morningman added the kind/fix Categorizes issue or PR as related to a bug. label Dec 14, 2020
Copy link
Member

@yangzhg yangzhg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Member

@yangzhg yangzhg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@morningman morningman merged commit 81c7c03 into apache:master Dec 15, 2020
morningman added a commit to baidu-doris/incubator-doris that referenced this pull request Jan 5, 2021
Introduced by PR apache#5051.
As @liutang123 said, when PlanFragmentExecutor is destructed, it will call
`close -> ExecNode::close -> OlapScanNode::close`. OlapScanNode will wait for `_transfer_thread`.
`_transfer_thread` will wait for all OlapScanner processing to complete.
OlapScanner is processed by the scanner thread. When the last scanner processing is completed,
`_transfer_thread` will break out of the loop, and PlanFragmentExecutor will continue to destruct.
And if it is completed, its RuntimeProfile::Counter will also be destructed.
At this time, the ScopedTimer in the Scan thread may still use this Counter when it is destructed.

So we must make sure that the timer is deconstructed before deconstructing the runtime profile.
@yangzhg yangzhg mentioned this pull request Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/fix Categorizes issue or PR as related to a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants