mrdrivingduck opened a new pull request, #233:
URL: https://github.com/apache/paimon-cpp/pull/233

   ## What does this PR do?
   
   While testing the OSS filesystem asynchronous read path, we found a 
lifecycle issue in `DefaultExecutor`. The issue is not OSS-specific: S3 
asynchronous reads use the same ownership pattern and can trigger it as well.
   
   The sequence is:
   
   1. An asynchronous object-store request submits a task that captures a 
`shared_ptr` to its client.
   2. The caller releases its client reference.
   3. A worker completes the task and releases the final client reference.
   4. The client and its executor are then destroyed on that worker thread.
   5. Executor shutdown tries to `join()` the current worker thread.
   
   Without this fix, joining the current thread throws `std::system_error` with 
`Resource deadlock avoided`. Since this happens during destruction, it can 
terminate the process.
   
   This PR separates the executor's shared scheduling state from the executor 
object. Workers retain the shared state rather than accessing the executor 
through `this`. When destruction happens on a worker, shutdown stops the shared 
state, joins the other workers, and detaches the current one. The current 
worker then finishes its task and exits normally.
   
   The PR adds a generic executor regression test and an S3 asynchronous 
range-read test covering this lifecycle.
   


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

Reply via email to