[refactor](scanner) use weak ptr to lock task execution context to avoid core in scanner dctor (#28493)
using weak ptr as a lock between fragment execute thread and scanner thread, to solve the core problem in scanner's dctor to access scannode's profile.
This commit is contained in:
@ -197,8 +197,7 @@ Status VScanNode::alloc_resource(RuntimeState* state) {
|
||||
if (_scanner_ctx) {
|
||||
DCHECK(!_eos && _num_scanners->value() > 0);
|
||||
RETURN_IF_ERROR(_scanner_ctx->init());
|
||||
RETURN_IF_ERROR(
|
||||
_state->exec_env()->scanner_scheduler()->submit(_scanner_ctx.get()));
|
||||
RETURN_IF_ERROR(_state->exec_env()->scanner_scheduler()->submit(_scanner_ctx));
|
||||
}
|
||||
if (_shared_scan_opt) {
|
||||
_shared_scanner_controller->set_scanner_context(id(),
|
||||
@ -218,7 +217,7 @@ Status VScanNode::alloc_resource(RuntimeState* state) {
|
||||
: Status::OK());
|
||||
if (_scanner_ctx) {
|
||||
RETURN_IF_ERROR(_scanner_ctx->init());
|
||||
RETURN_IF_ERROR(_state->exec_env()->scanner_scheduler()->submit(_scanner_ctx.get()));
|
||||
RETURN_IF_ERROR(_state->exec_env()->scanner_scheduler()->submit(_scanner_ctx));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user