Gabriel39 commented on code in PR #69625:
URL: https://github.com/apache/doris/pull/69625#discussion_r4384330702


##########
be/src/format_v2/table/lance_reader.cpp:
##########
@@ -1261,6 +1286,7 @@ void LanceTableReader::_close_dataset() {
         _fts_query_context = nullptr;
     }
     if (_dataset != nullptr) {
+        _collect_session_cache_statistics();

Review Comment:
   Fixed in 9e52ffd3b1c345fbd07de268451240624a3cee70.
   
   Active Session observation windows are now sampled before RuntimeProfile 
copies counters and availability information to Thrift or protobuf. The 
callback owns independent observation state and never accesses the reader, 
dataset or scanner handles. Sampling and close advance one baseline under a 
mutex; late close only publishes the remaining delta and ends the window. Weak 
registration tokens expire safely, and first-use Session initialization stays 
outside the sampling lock.
   
   The new test holds a real Lance native execution callback while another 
worker completes LIMIT 1, then saves the profile before releasing the held 
read. With snapshot publication disabled it reproduces the missing window (9 
misses saved versus at least 19); the fixed test passes. Additional tests cover 
overlapping windows, concurrent snapshot/close, repeated snapshots, reopen, 
expired registrations and failed snapshots. The existing reader test now 
inspects its profile before closing.
   
   All 14 focused C++ tests passed with ASAN/UBSAN and leak detection enabled, 
using the pinned upstream SDK plus the unchanged Foyer patch. Full reader/test 
syntax checks and clang-format 16 checks on all 15 affected PR C++ files 
passed. Full Doris build and external regression remain for CI. The saved 
observation ends at the final snapshot; subsequent native work is outside that 
immutable copy, as documented.
   



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