stdpain opened a new issue, #3383:
URL: https://github.com/apache/brpc/issues/3383

   **Describe the bug**
   
   bthread::TimerThread only reclaims a task's pooled Task slot when the task 
is finally popped from its internal min-heap at its run_time. unschedule() 
merely marks the task as removed (bumps its version)
     and intentionally does not return the slot — reclamation is deferred to 
the timer thread. As a result, a task that is cancelled early still occupies 
its slot for a long time, and the live Task count
     grows to roughly qps * timeout even though almost all of those tasks were 
unscheduled long ago.
   
   
   **To Reproduce**
   
     1. Start a TimerThread.
     2. Repeatedly schedule() tasks with a large abstime (e.g. 
seconds_from_now(3600)) and unschedule() them shortly after — mimicking RPC 
deadline timers that are almost always cancelled before firing.
     3. Watch the number of allocated Task objects (ResourcePool<Task>) / 
process RSS.
   
   
   
   **Expected behavior**
   
   
   **Versions**
   OS:
   Compiler:
   brpc:
   protobuf:
   
   **Additional context/screenshots**
   
   


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