Loyal-Young opened a new issue, #11254:
URL: https://github.com/apache/rocketmq/issues/11254

   ### Before Creating the Bug Report
   
   - [x] I inspected the current develop code and searched related issues/open 
pull requests.
   
   ### Summary
   
   ThreadUtils.shutdownGracefully(Thread,long) loops after every timed join, so 
a finite timeout does not bound the call. If the caller is interrupted, it 
restores its interrupt flag inside that loop and immediately throws from join 
again, spinning until the worker terminates.
   
   ### Steps to Reproduce
   
   Use a worker that cannot stop until a latch is released. 
shutdownGracefully(worker,50) must return before that latch is released, and an 
already-interrupted caller must return without spinning.
   
   ### Expected Behavior
   
   Interrupt the worker once and perform one bounded/interruptible join while 
preserving caller interruption.
   
   ### Environment / Additional Context
   
   - Reproduced against develop commit 
`78b96bc5e21216cd7896efae08f90c5cde4cae53`.
   - Regression test: `ThreadUtilsShutdownTest`.
   - The regression fails before the fix and passes afterward on JDK 8.
   - Proposed change is limited to the existing implementation; no protocol or 
new API is introduced.
   
   


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