nodece opened a new pull request, #4488:
URL: https://github.com/apache/bookkeeper/pull/4488

   Fix #4465
   
   ### Motivaction
   
   In `SingleThreadExecutor`, the `runner` drains the full `queue` into the 
`localTasks`, when the `localTasks` has not been run, the `queue` is really 
full(the `localTasks` equals to the `queue`) at this point.
   
   When calling the `execute()` method, which shouldn't add the `runnable` to 
the `queue`, which would double the actual number of `runable`, increasing 
memory usage and potential OOM issues.
   
   ### Changes
   
   Add a variable to record the `runnable` count:
   
   - When we add the runnable to the queue, the value is increased by 1.
   - When we run the runnable, the value is reduced by 1. 
   


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