github-actions[bot] commented on code in PR #69882:
URL: https://github.com/apache/doris/pull/69882#discussion_r4422789449


##########
be/src/storage/index/inverted/snii/snii_doris_adapter.cpp:
##########
@@ -307,7 +312,7 @@ Status DorisSniiFileReader::read_batch(const 
std::vector<::doris::snii::io::Rang
         // Same shape as the hedged-read path in 
cached_remote_file_reader.cpp:500-505.
         const std::shared_ptr<ResourceContext> parent_resource_ctx =
                 thread_context()->resource_ctx();
-        for (size_t base = 0; base < num_segs; base += kMaxConcurrentReads) {
+        for (size_t base = first; base < num_segs; base += 
kMaxConcurrentReads) {
             const size_t wave_end = std::min(base + kMaxConcurrentReads, 
num_segs);
             ::doris::CountDownLatch latch(cast_set<int>(wave_end - base));
             for (size_t s = base; s < wave_end; ++s) {

Review Comment:
   [P1] Handle retained runnables when partial handoff submission fails — 
`fan_out(next)` now exposes small local batches to a `ThreadPool::submit_func` 
failure mode that can retain the runnable. `ThreadPool::do_submit` queues the 
callback before trying to create a worker and returns the creation error with 
the callback still queued when no worker exists. The fallback then runs this 
segment inline and decrements the latch, while the retained lambda captures 
`run_segment` and `latch` by reference; if a worker later starts, it can 
execute the segment a second time and dereference those dead stack captures. 
Preserve the callback's ownership/execution until the submit outcome is known, 
or avoid the inline fallback for an error that may have retained the runnable, 
and ensure the latch is decremented exactly once.



-- 
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]

Reply via email to