Aias00 commented on PR #6429:
URL: https://github.com/apache/shenyu/pull/6429#issuecomment-5193463757

   Good fix — and a real concurrency bug, not just style. `beginTime` was an 
instance field on the `DividePlugin` Spring singleton, so concurrent requests 
overwrote each other's start time: request B's `beginTime = 
System.currentTimeMillis()` would clobber request A's, so A's 
`successResponseTrigger` computed its elapsed time against B's start. Moving it 
to a local captured by the lambda gives each request its own start. The test 
cleanup (dropping the reflective field set, 
`loadBalancerFactoryMockedStatic.close()`) is a nice side effect.
   


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