zhiqiang-hhhh commented on code in PR #40493:
URL: https://github.com/apache/doris/pull/40493#discussion_r1824377333


##########
be/src/io/fs/buffered_reader.cpp:
##########
@@ -415,10 +415,36 @@ void PrefetchBuffer::reset_offset(size_t offset) {
     } else {
         _exceed = false;
     }
+
+    // The "io_ctx" in the input parameter belongs to the upper caller.
+    // Because PrefetchBuffer actually runs in another thread,
+    // its life cycle may be different from that of the caller.
+    // Therefore, before submitting PrefetchBuffer to the thread pool,
+    // we need to copy io_ctx to _owned_io_ctx to ensure that
+    // the life cycle of IOContext is consistent with that of PrefetchBuffer.
+    // _update_and_reset_io_context(io_ctx);
     _prefetch_status = 
ExecEnv::GetInstance()->buffered_reader_prefetch_thread_pool()->submit_func(
             [buffer_ptr = shared_from_this()]() { 
buffer_ptr->prefetch_buffer(); });
 }
 
+void PrefetchBuffer::_update_and_reset_io_context(const IOContext* io_ctx) {

Review Comment:
   when does this method is called?



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to