BiteTheDDDDt opened a new pull request, #64552:
URL: https://github.com/apache/doris/pull/64552
### What problem does this PR solve?
Issue Number: close #xxx
Related PR: #62954
Problem Summary: Backport #62954 to branch-4.1. During BE shutdown,
FragmentMgr clears `_query_ctx_map_delay_delete`. The old
`ConcurrentContextMap::clear()` destroyed map values while holding the shard
mutex. Releasing the last `QueryContext` reference can run
`QueryContext::~QueryContext()`, which calls back into
`FragmentMgr::remove_query_context()` and attempts to erase from the same
delay-delete map, causing `std::system_error` with `Resource deadlock avoided`
and then BE abort. The fix swaps each shard map into a local map under the
lock, releases the lock, and only then destroys the values.
### Release note
None
### Check List (For Author)
- Test:
- Manual test: `git diff --check upstream/branch-4.1..HEAD`
- Manual test: `./build-support/check-format.sh`
- Unit Test: `./run-be-ut.sh --run
--filter=FragmentMgrDelayDeleteMapTest.*` was started locally but not completed
because it triggered a full ASAN_UT rebuild (`14920` ninja targets); the run
was interrupted before test execution.
- Behavior changed: No
- Does this need documentation: No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]