Re: [PR] fix batch create stream and make SetHostSocket thread safe (brpc)
jenrryyou commented on code in PR #2938: URL: https://github.com/apache/brpc/pull/2938#discussion_r2030132594 ## src/brpc/stream_impl.h: ## @@ -134,6 +134,7 @@ friend struct butil::DefaultDeleter; butil::IOBuf *_pending_buf; int64_t _start_idle_timer_us; bthread_timer_t _idle_timer; +std::once_flag set_host_socket_flag; Review Comment: done -- 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: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org
[PR] Fix class data for protobuf v26+ (brpc)
wasphin opened a new pull request, #2941: URL: https://github.com/apache/brpc/pull/2941 ### What problem does this PR solve? Issue Number: #2917 Problem Summary: ### What is changed and the side effects? Changed: 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: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org
Re: [I] some function not work in protobuf v5 (brpc)
wasphin commented on issue #2917: URL: https://github.com/apache/brpc/issues/2917#issuecomment-2781498642 抱歉这一段事情比较多,没太顾上。 验证了下,应该并不是隐藏 New 导致的,使用 28.3 版本编译并没有问题,问题出在运行的时候。Protobuf 26+ 后开始使用 `ClassData` 存储一些元信息,`GetMetadata` 改为基于该信息实现。 -- 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: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org
Re: [PR] Fix class data for protobuf v27+ (brpc)
wwbmmm commented on PR #2941: URL: https://github.com/apache/brpc/pull/2941#issuecomment-2781846007 LGTM -- 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: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org
Re: [PR] fix batch create stream and make SetHostSocket thread safe (brpc)
wwbmmm commented on PR #2938: URL: https://github.com/apache/brpc/pull/2938#issuecomment-2781844799 LGTM -- 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: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org
Re: [PR] epoll bthread deal first (brpc)
wwbmmm commented on code in PR #2819: URL: https://github.com/apache/brpc/pull/2819#discussion_r2030365543 ## src/bthread/task_control.h: ## @@ -153,6 +157,7 @@ friend bthread_t init_for_pthread_stack_trace(); std::vector*> _tagged_cumulated_worker_time; std::vector>*> _tagged_worker_usage_second; std::vector*> _tagged_nbthreads; +std::vector> _priority_qs; Review Comment: _priority_queues ## src/bthread/task_control.h: ## @@ -97,6 +97,10 @@ friend bthread_t init_for_pthread_stack_trace(); std::string stack_trace(bthread_t tid); #endif // BRPC_BTHREAD_TRACER +void push_priority_q(bthread_tag_t tag, bthread_t tid) { Review Comment: push_priority_queue ## src/bthread/task_control.cpp: ## @@ -430,6 +435,11 @@ int TaskControl::_destroy_group(TaskGroup* g) { bool TaskControl::steal_task(bthread_t* tid, size_t* seed, size_t offset) { auto tag = tls_task_group->tag(); + +if (_priority_qs[tag].steal(tid)) { Review Comment: 所有线程都访问这个是否会造成全局竞争? ## src/brpc/event_dispatcher_epoll.cpp: ## @@ -70,7 +70,8 @@ int EventDispatcher::Start(const bthread_attr_t* consumer_thread_attr) { // Set _thread_attr before creating epoll thread to make sure // everyting seems sane to the thread. _thread_attr = consumer_thread_attr ? -*consumer_thread_attr : BTHREAD_ATTR_NORMAL; +*consumer_thread_attr : _thread_attr; Review Comment: 默认的attr就是EPOLL,这里是不是可以改成这样更直观一些: ``` if (consumer_thread_attr) { _thread_attr = *consumer_thread_attr | BTHREAD_GLOBAL_PRIORITY } ``` ## src/bthread/task_group.h: ## @@ -200,6 +200,8 @@ class TaskGroup { return total_ns; } +const bthread_attr_t& get_current_attr() { return _cur_meta->attr; } Review Comment: 这个方法好像没有必要,目前只有task_group.cpp里面用到,那里可以直接访问到_cur_meta->attr -- 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: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org
[PR] iobuf support reserve_aligned (brpc)
yanglimingcn opened a new pull request, #2942: URL: https://github.com/apache/brpc/pull/2942 ### What problem does this PR solve? IOBuf通过reserve_aligned(size_t n, size_t alignment)函数在IOBuf内部预分配一些符合对齐规则的内存,后续可以通过unsafe_assign函数或者IOBufAsZeroCopyInputStream等函数把这些内存段解析出来,让用户填充数据。 这样做的好处是,统一使用IOBuf的内存管理机制,典型的如RDMA这种内存需要注册的场景,用户自己去注册会比较麻烦。 Issue Number: Problem Summary: ### What is changed and the side effects? Changed: 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: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org
Oncall report from Mar.31st to Apr.6th
Hi all, Over the past week, the following PRs were merged: * Fix compiler optimize thread local variable access #2918 ( https://github.com/apache/brpc/pull/2918) * jemalloc profiler support objects #2929 ( https://github.com/apache/brpc/pull/2929) Best regards, Lorin Lee