chenBright opened a new pull request, #3683:
URL: https://github.com/apache/brpc/pull/3683

   ### What problem does this PR solve?
   
   Issue Number: resolve #1120
   
   Problem Summary:
   
   When event dispatchers occupy all bthread workers in `epoll_wait` or 
`kevent`, 
   other bthreads cannot run. This can stall request processing and server 
shutdown, 
   particularly when `event_dispatcher_num >= num_threads`.
   
   ### What is changed and the side effects?
   
   Changed:
   
     - Add `bthread_add_reserved_concurrency_by_tag(num, tag)` to increment 
reserved concurrency.
     - Reserve an extra worker for each event dispatcher and internal epoll 
bthread. Reserved workers are 
        created eagerly, including when lazy  growth is enabled.
     - Track normal and reserved concurrency separately. Keep 
`TaskControl::concurrency()` as their total.
     - Use independent per-tag limits of 1024 normal workers and 512 reserved 
workers, allowing reservations 
        even when normal concurrency reaches its limit.
   
   Side effects:
   - Performance effects:
   
   - Breaking backward compatibility: 
   
   ---
   ### Check List:
   - Please make sure your changes are compilable.
   - When providing us with a new feature, it is best to add related tests.
   - Please follow [Contributor Covenant Code of 
Conduct](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md).
   


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