ZhengweiZhu opened a new pull request, #3096: URL: https://github.com/apache/brpc/pull/3096
User can check all living bthreads by `curl ip:port/bthreads/all` or `curl ip:port/bthreads/all?st=1` to show bthread stack trace. This is an enhancement of the original /bthreads service which provides a method to check a specified bthread by designated bthread id, as user has no idea what the bthread id is. Condisering the performance cost brought by recording the bthread id on bthread startup and finish, currently this function is only enabled when BRPC_BTHREAD_TRACER is defined. ### What problem does this PR solve? brpc kindly provides a bthreads_service to check a specified thread by curl ip:port/bthreads/<bthread_id>. The problem is that we have no idea what the <bthread_id> is as it is generated by code, which makes this service useless. Issue Number: #3088 Problem Summary: ### What is changed and the side effects? Changed: when BRPC_BTHREAD_TRACER is defined: 1. add method to record bthread id on bthread startup and finish. 2. add /bthreads/all and /bthreads/all?st=1 service for user Side effects: - Performance effects: To test the performance cost I use one rdma_performance_client and rdma_performance_server in each machine, with TCP mode enabled: <img width="2162" height="432" alt="image" src="https://github.com/user-attachments/assets/0f7d3fd6-45bb-4ed6-9add-f7075392482e" /> This commit use multiple spin lock by sharding to minimize performance effects. - Breaking backward compatibility: N/A --- ### 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]
