Zouxxyy opened a new pull request, #13152:
URL: https://github.com/apache/gluten/pull/13152

   ## What changes are proposed in this pull request?
   
   Release JNI daemon attachments at Gluten-managed native worker exit on 
Linux/glibc, without restoring task/iterator-level detachment removed by #11896.
   
   Register lifecycle state at worker entry through a shared Folly thread 
factory and an explicit-thread wrapper. Borrow existing attachments and track 
only attachments made by Gluten. Defer detachment to the final pthread 
destructor pass so normal C++ TLS, Folly and libhdfs cleanup can still use JNI. 
Reject new attachments after final cleanup.
   
   Unmanaged threads and other platforms retain their existing attachment 
behavior. This is not an ordering guarantee for arbitrary destructors that 
repeatedly re-arm TLS keys; JNI-dependent cleanup must finish before Gluten’s 
final callback, and the JVM must outlive its workers. No Paimon native 
dependency is introduced.
   
   ## How was this patch tested?
   
   On Linux x86-64, 21 standalone cases passed on Java 8 and Java 17, repeated 
25 times each: 1,050 successful case executions. Coverage includes real Folly 
CPU/IO pools, std::async workers, attachment ownership and real libhdfs 
local-file cleanup.
   
   The actual libgluten-linked core suite passed 17/17 cases. Formatting, 
whitespace and license-header presence checks passed. Full community Velox/Bolt 
builds and Spark end-to-end tests have not been run locally.
   
   ## Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: OpenAI Codex CLI 0.156.0
   


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