github-actions[bot] commented on code in PR #69422:
URL: https://github.com/apache/doris/pull/69422#discussion_r4344456972
##########
be/src/load/channel/load_stream_mgr.h:
##########
@@ -53,8 +53,10 @@ class LoadStreamMgr {
return result;
}
- // only used by ut
- size_t get_load_stream_num() { return _load_streams_map.size(); }
+ size_t get_load_stream_num() {
+ std::lock_guard<std::mutex> lock(_lock);
Review Comment:
[P1] Keep the shutdown stream census off blocking cleanup locks
This mutex can be held for the entire duration of unfinished file writes: on
an abnormal sender disconnect/idle close, `LoadStream::on_closed()` calls
`clear_load()`, which erases the owning `unique_ptr` under `_lock`; destruction
then reaches `IndexStream::~IndexStream()` ->
`TabletStream::wait_for_flush_tasks()` and an untimed token wait/shutdown. If a
flush is stalled on storage I/O, the new `wait_for_all_tasks_done()` call to
this accessor blocks before it can check `grace_shutdown_wait_seconds`, so even
a zero grace period cannot reach the forced-exit path. Use a nonblocking
active-stream counter, or release the manager lock before destruction/waits, so
polling cannot defeat the shutdown deadline.
--
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]