sollhui opened a new pull request, #67580: URL: https://github.com/apache/doris/pull/67580
### What problem does this PR solve? A VTabletWriter sender bthread can crash while leaving _send_batch_process in AddThreadMemTrackerConsumer::~AddThreadMemTrackerConsumer. Scoped thread-local handles acquired a bthread ThreadContext, but later context lookup and release preferred pthread TLS. If the bthread resumed on a pthread with its own context, scope cleanup could pop or release a different context. ### What is changed? - Resolve bthread context before pthread context. - Return the exact ThreadContext acquired by ThreadLocalHandle. - Keep that context in AttachTask and AddThreadMemTrackerConsumer and use it for matching cleanup. This makes scoped attach/push and detach/pop operate on the same ThreadContext across bthread scheduling. ### Test - Not run locally; formatting and git diff checks only. -- 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]
