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


##########
be/src/format_v2/jni/jni_table_reader.cpp:
##########
@@ -459,6 +472,55 @@ Status JniTableReader::_open_jni_scanner() {
     }
     _apply_common_scanner_params();
 
+    // Only the connector of a statement that set enable_jni_heap_admission 
declares the heap a
+    // reader will hold, and only for the readers that hold much; every other 
reader opens at once.
+    if (_current_range.__isset.jni_heap_bytes && _current_range.jni_heap_bytes 
> 0) {
+        // The scanner's try_stop() marks its IOContext: a cancelled query, a 
satisfied limit, a
+        // closing scan. The gate asks on a thread of its own, so the check 
owns what it reads.

Review Comment:
   [P2] Synchronize the gate's scanner-stop signal. When a scan stops, 
FileScannerV2::try_stop writes IOContext::should_stop (a plain bool), while the 
gate's polling thread calls this lambda without a common lock. V1 installs the 
same callback. This is a C++ data race, so a canceled waiter may not be 
observed reliably. Use an atomic stop flag or another synchronized token in 
both reader paths.



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