Re: [PR] Fix multi FlatMap scale and size (brpc)

2024-07-09 Thread via GitHub


wasphin commented on PR #2669:
URL: https://github.com/apache/brpc/pull/2669#issuecomment-2219482112

   这个是不是可以合了?


-- 
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] Support arena allocation for server mode in native protocol (brpc)

2024-07-09 Thread via GitHub


chenBright commented on issue #2671:
URL: https://github.com/apache/brpc/issues/2671#issuecomment-2219393571

 ```c++
   class ProtobufMessageManager {
   public:
   virtual google::protobuf::Message* GetMessage(const 
google::protobuf::Message* message_prototype) = 0;
   virtual void ReturnMessage(google::protobuf::Message* message) = 0;
   };
   ```
   User implements `ProtobufMessageManager` and sets the derived class instance 
to `ServerOptions::pb_message_manager`。Then, the server will get  request and 
response from the derived class instance in `ProcessRpcRequest`, return them in 
`SendRpcResponse`。
   
   @oathdruid Any suggestion?
   


-- 
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] 有考虑过添加可以阻塞在bthread上的promise/future吗 (brpc)

2024-07-09 Thread via GitHub


chenBright closed issue #1363: 有考虑过添加可以阻塞在bthread上的promise/future吗
URL: https://github.com/apache/brpc/issues/1363


-- 
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] 有考虑过添加可以阻塞在bthread上的promise/future吗 (brpc)

2024-07-09 Thread via GitHub


chenBright commented on issue #1363:
URL: https://github.com/apache/brpc/issues/1363#issuecomment-2217635840

   
[babylon](https://github.com/baidu/babylon)支持在bthread上使用[future](https://github.com/baidu/babylon/blob/main/docs/future.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] 有考虑过添加可以阻塞在bthread上的promise/future吗 (brpc)

2024-07-09 Thread via GitHub


pilife commented on issue #1363:
URL: https://github.com/apache/brpc/issues/1363#issuecomment-2217526718

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



[I] brpc 代码中定义的一些bvar监控项比如process_cpu_usage一直不更新 (brpc)

2024-07-09 Thread via GitHub


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

   **Describe the bug (描述bug)**
brpc 代码中定义的一些bvar监控项一直不更新。 
比如process_cpu_usage,process_memory_data_and_stack等。 
   但是有一些自定义的bvar是变动的。 
   但是进程重启后可能又恢复, 可能再次重启又不动了。 
   
   **To Reproduce (复现方法)**
   
   
   **Expected behavior (期望行为)**
   
   
   **Versions (各种版本)**
   OS:   5.4.0-139-generic #156-Ubuntu SMP Fri Ja
   Compiler: 
   brpc:  1.7.0 
   protobuf:
   
   **Additional context/screenshots (更多上下文/截图)**
   这个就是一直不变,一直是0
   
![image](https://github.com/apache/brpc/assets/9008320/4070fbea-8834-4d60-bb85-452d35553d3a)
   
![image](https://github.com/apache/brpc/assets/9008320/8b1949d2-3239-4223-84ab-f863656b31ab)
   
   


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



[I] TLS (brpc)

2024-07-09 Thread via GitHub


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

   请问bRPC支持mTLS嘛?应用层使用grpc:h2协议。
   
   


-- 
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.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] server中brpc::StreamWait卡在了thread::TaskGroup::sched_to (brpc)

2024-07-09 Thread via GitHub


GreateCode commented on issue #2680:
URL: https://github.com/apache/brpc/issues/2680#issuecomment-2216963252

   > > 另外brpc::StreamClose也释放不了,对吧。
   > 
   > 可以释放的。
   > 
   > > brpc目前还没支持tcp_user_timeout吧
   > 
   > 后续提个PR支持tcp_user_timeout。
   
   


-- 
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] Questions about idle_timeout_sec of server (brpc)

2024-07-09 Thread via GitHub


BiteThet closed issue #2681: Questions about idle_timeout_sec of server
URL: https://github.com/apache/brpc/issues/2681


-- 
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] server中brpc::StreamWait卡在了thread::TaskGroup::sched_to (brpc)

2024-07-09 Thread via GitHub


chenBright commented on issue #2680:
URL: https://github.com/apache/brpc/issues/2680#issuecomment-2216710439

   > 另外brpc::StreamClose也释放不了,对吧。
   
   可以释放的。
   
   > brpc目前还没支持tcp_user_timeout吧
   
   后续提个PR支持tcp_user_timeout。
   


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



[I] [E1008]Reached timeout=10000ms (brpc)

2024-07-08 Thread via GitHub


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

   **Describe the bug (描述bug)**
   brpc客户端在连接空闲了一段时间后,大约1.5h,再次请求发现会会报这样的错误 `[E1008]Reached 
timeout=1ms`,大约再过了15分钟后,问题不再出现。
   
   **To Reproduce (复现方法)**
   brpc客户端在连接空闲了一段时间后,大约1.5h,再次请求发现会会报这样的错误 `[E1008]Reached timeout=1ms`
   
   **Expected behavior (期望行为)**
   正常请求,不报E1008错误
   
   **Versions (各种版本)**
   OS: centos7.9
   Compiler: gcc 9.3.1
   brpc: -
   protobuf: -
   
   **Additional context/screenshots (更多上下文/截图)**
   ``` cpp
   Client::Client() {
 auto config = ConfigManager::GetConfigManager();
   
 brpc::ChannelOptions options;
   
 options.protocol = config->GetConfigParam(
 "risk_control", "protocol", "baidu_std");
 options.connection_type = config->GetConfigParam(
 "risk_control", "connection_type", "");
 options.timeout_ms =
 config->GetConfigParam("risk_control", "timeout_ms", "100");
 options.max_retry =
 config->GetConfigParam("risk_control", "max_retry", "3");
   
 const std::string server = config->GetConfigParam(
 "risk_control", "server", "0.0.0.0:8000");
 const std::string load_balancer =
 config->GetConfigParam("risk_control", "load_balancer", 
"");
   
 if (channel_.Init(server.c_str(), load_balancer.c_str(), ) != 0) {
   SLOG_ERROR("", "RiskControl", "Client Init failed", 0, 0);
 }
 stub_.reset(new rc::AsyncRcService_Stub(_));
   }
   ```
   初步分析了下,应该是tcp连接假死导致应用层没有感知到,触发了TCP的超时重传。
   
   但是有一个疑问就是tcp连接为啥会假死呢,通过`lsof`命令查看客户端和服务端的TCP连接都是`established`的状态
   


-- 
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.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] 链接jemalloc后可能会有死锁的问题 (brpc)

2024-07-08 Thread via GitHub


chenBright commented on issue #859:
URL: https://github.com/apache/brpc/issues/859#issuecomment-2216297439

   @niukuo @lrita 可以使用#2684 看还有没有问题。


-- 
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] 链接jemalloc后可能会有死锁的问题 (brpc)

2024-07-08 Thread via GitHub


chenBright commented on issue #859:
URL: https://github.com/apache/brpc/issues/859#issuecomment-2216287449

   > > 临时解决方式: 设置 bvar_collector_expected_per_second=0
   > 
   > 这个什么原理?
   
   相当于关闭采样,不触发content profiler吧。


-- 
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] server中brpc::StreamWait卡在了thread::TaskGroup::sched_to (brpc)

2024-07-08 Thread via GitHub


GreateCode commented on issue #2680:
URL: https://github.com/apache/brpc/issues/2680#issuecomment-2213837811

   > tcp_user_timeout
   
   brpc目前还没支持tcp_user_timeout吧。
   另外brpc::StreamClose也释放不了,对吧。


-- 
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] gdb_bthread_stack.py not work. (brpc)

2024-07-08 Thread via GitHub


zhaoyulong commented on issue #2674:
URL: https://github.com/apache/brpc/issues/2674#issuecomment-2213631980

   > 编译的时候加了-g么?
   
   加了


-- 
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] server中brpc::StreamWait卡在了thread::TaskGroup::sched_to (brpc)

2024-07-08 Thread via GitHub


chenBright commented on issue #2680:
URL: https://github.com/apache/brpc/issues/2680#issuecomment-2213600923

   idle机制不能解决这个问题。
   
   可能需要借助tcp_user_timeout(#1154)来断开连接。


-- 
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] keytable管理问题咨询 (brpc)

2024-07-08 Thread via GitHub


MJY-HUST closed issue #2635: keytable管理问题咨询
URL: https://github.com/apache/brpc/issues/2635


-- 
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] gdb_bthread_stack.py not work. (brpc)

2024-07-08 Thread via GitHub


GreateCode commented on issue #2674:
URL: https://github.com/apache/brpc/issues/2674#issuecomment-2213518207

   加了


-- 
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] GRPC python client can not read big response from BRPC server (brpc)

2024-07-08 Thread via GitHub


dashjay commented on issue #2676:
URL: https://github.com/apache/brpc/issues/2676#issuecomment-2213364819

   You can easily use command like this to access BRPC server with http proto
   ```
   dd if=/dev/random of=/tmp/test bs=4M count=1
   echo "{\"message\": \"$(cat /tmp/test | base64)\"}" > test.1
   curl -H 'Content-Type: application/json' --data-binary "@./test.1" 
0.0.0.0:8000/EchoService/Echo > /tmp/test.2
   
   ```
   
   But you can not use grpc client to do this.


-- 
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 multi FlatMap scale and size (brpc)

2024-07-08 Thread via GitHub


wwbmmm commented on PR #2669:
URL: https://github.com/apache/brpc/pull/2669#issuecomment-2213126321

   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: [I] variable.cpp error: ‘StringFlagDestructor’ does not name a type (brpc)

2024-07-07 Thread via GitHub


skyflower commented on issue #2679:
URL: https://github.com/apache/brpc/issues/2679#issuecomment-2212953955

   ok, I'll try it. Thank you for your help.


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



[I] 线程池的线程回收退时core在brpc https://github.com/apache/brpc/issues/1606 (brpc)

2024-07-07 Thread via GitHub


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

   **Describe the bug (描述bug)**
   使用jni加载brpc.so时报pthread_mutex_lock未定义,
   使用export LD_PRELOAD=/usr/lib64/libbrpc.so  解决了加载的问题,但java线程在退出时core掉了。
   
   **To Reproduce (复现方法)**
   使用jni加载brpc.so 并在java中使用线程,观察 线程退出时会不会产生core
   
   **Expected behavior (期望行为)**
   能够 正常使用
   
   **Versions (各种版本)**
   OS:
   Compiler:
   brpc:
   protobuf:
   
   **Additional context/screenshots (更多上下文/截图)**
   #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
   https://github.com/apache/brpc/issues/1 0x7f259f32ff95 in __GI_abort () 
at abort.c:79
   https://github.com/apache/brpc/issues/2 0x7f259b95be09 in 
os::abort(bool) () from 
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64/jre/lib/amd64/server/libjvm.so
   https://github.com/apache/brpc/issues/3 0x7f259bb8367a in 
VMError::report_and_die() () from 
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64/jre/lib/amd64/server/libjvm.so
   https://github.com/apache/brpc/issues/4 0x7f259b965fb5 in 
JVM_handle_linux_signal () from 
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64/jre/lib/amd64/server/libjvm.so
   https://github.com/apache/brpc/issues/5 0x7f259b958fc8 in 
signalHandler(int, siginfo_t*, void*) () from 
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64/jre/lib/amd64/server/libjvm.so
   https://github.com/apache/brpc/issues/6
   https://github.com/apache/brpc/pull/7 0x in ?? ()
   https://github.com/apache/brpc/issues/8 0x7f25a008b80a in 
~ThreadExitHelper (this=0x55d1764021e0, __in_chrg=) at 
/root/volume/src/EDS5.1.0/eds-deps/src/brpc/src/butil/thread_local.cpp:41
   https://github.com/apache/brpc/pull/9 
butil::detail::delete_thread_exit_helper (arg=0x55d1764021e0) at 
/root/volume/src/EDS5.1.0/eds-deps/src/brpc/src/butil/thread_local.cpp:80
   https://github.com/apache/brpc/pull/10 0x7f259fce5a78 in 
__nptl_deallocate_tsd () at pthread_create.c:301
   https://github.com/apache/brpc/issues/11 0x7f259fce698d in 
__nptl_deallocate_tsd () at ../sysdeps/nptl/futex-internal.h:82
   https://github.com/apache/brpc/issues/12 start_thread (arg=0x7f24d3031700) 
at pthread_create.c:488
   https://github.com/apache/brpc/issues/13 0x7f259f3eebef in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:95
   
   (gdb) p pd->specific
   $3 = {0x7f24d3031a10, 0x0 }
   (gdb) p pd->specific[0]
   $4 = {seq = 1, data = 0x0}
   (gdb) p __pthread_keys
   $5 = {{seq = 1, destr = 0x7f25a008b750 
butil::detail::delete_thread_exit_helper(void*)}, {seq = 1, destr = 
0x7f259f6b7340 }, {seq = 1,
   destr = 0x7f259b958bb0 }, {seq = 1, destr = 
0x7f25266e0420 }, {seq = 0, destr = 0x0} }
   
   我在butil/thread_local.cpp 文件 里面 注册和除 的时候 都 加了日志,但是只有删除 的时候 打印了日志:
   thread 0x7f24d3031700 key 0 delete 0x55d1764021e0
   thread 0x7f24d3031700 fns 0x55d1764021e0 num 8737345935673
   thread 0x7f25266d7270 first 0x7f25266d74c0 second (nil)
   thread 0x0 first 0x1 second (nil)
   
   删除ThreadExitHelper传入的内存是有问题的。这个问题和brpc.so的加载 顺序有关系 。
   开始是和 https://github.com/apache/brpc/issues/2266 这个问题有关,加载libbrpc.so会报 
pthread_mutex_lock 未定义
   通过https://github.com/apache/brpc/issues/1086 这个方法,export 
LD_PRELOAD=/usr/lib64/libbrpc.so 解决了问题
   但是在java线程退出的时候 就直接 core掉了。
   我现在按照 https://github.com/apache/brpc/issues/2266 
这个解决方案,将pthread_mutex_lock函数注释 掉。然后去掉export 
LD_PRELOAD=/usr/lib64/libbrpc.so是没有问题的。没搞清楚为什么使用export 
LD_PRELOAD=/usr/lib64/libbrpc.so 会有问题。
   
   怀疑还是和pthread函数冲突有关系 。
   


-- 
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.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] 线程池的线程回收退时core在brpc (brpc)

2024-07-07 Thread via GitHub


ligangbin117 commented on issue #1606:
URL: https://github.com/apache/brpc/issues/1606#issuecomment-2212885281

   我在使用jni调用brpc的时候 也遇到了这个问题。
   #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
   #1  0x7f259f32ff95 in __GI_abort () at abort.c:79
   #2  0x7f259b95be09 in os::abort(bool) () from 
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64/jre/lib/amd64/server/libjvm.so
   #3  0x7f259bb8367a in VMError::report_and_die() () from 
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64/jre/lib/amd64/server/libjvm.so
   #4  0x7f259b965fb5 in JVM_handle_linux_signal () from 
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64/jre/lib/amd64/server/libjvm.so
   #5  0x7f259b958fc8 in signalHandler(int, siginfo_t*, void*) () from 
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64/jre/lib/amd64/server/libjvm.so
   #6  
   #7  0x in ?? ()
   #8  0x7f25a008b80a in ~ThreadExitHelper (this=0x55d1764021e0, 
__in_chrg=) at 
/root/volume/src/EDS5.1.0/eds-deps/src/brpc/src/butil/thread_local.cpp:41
   #9  butil::detail::delete_thread_exit_helper (arg=0x55d1764021e0) at 
/root/volume/src/EDS5.1.0/eds-deps/src/brpc/src/butil/thread_local.cpp:80
   #10 0x7f259fce5a78 in __nptl_deallocate_tsd () at pthread_create.c:301
   #11 0x7f259fce698d in __nptl_deallocate_tsd () at 
../sysdeps/nptl/futex-internal.h:82
   #12 start_thread (arg=0x7f24d3031700) at pthread_create.c:488
   #13 0x7f259f3eebef in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:95
   
   
   (gdb) p pd->specific
   $3 = {0x7f24d3031a10, 0x0 }
   (gdb) p *pd->specific[0]
   $4 = {seq = 1, data = 0x0}
   (gdb) p __pthread_keys
   $5 = {{seq = 1, destr = 0x7f25a008b750 
}, {seq = 1, destr = 
0x7f259f6b7340 }, {seq = 1,
   destr = 0x7f259b958bb0 }, {seq = 1, destr 
= 0x7f25266e0420 }, {seq = 0, destr = 0x0} }
   
   
   我在butil/thread_local.cpp 文件 里面  注册和除 的时候 都 加了日志,但是只有删除 的时候 打印了日志:
   thread 0x7f24d3031700 key 0 delete 0x55d1764021e0
   thread 0x7f24d3031700 fns 0x55d1764021e0 num 8737345935673
   thread 0x7f25266d7270 first 0x7f25266d74c0 second (nil)
   thread 0x0 first 0x1 second (nil)
   
   删除ThreadExitHelper传入的内存是有问题的。这个问题和brpc.so的加载 顺序有关系 。
   开始是和 https://github.com/apache/brpc/issues/2266 这个问题有关,加载libbrpc.so会报 
pthread_mutex_lock 未定义
   通过https://github.com/apache/brpc/issues/1086这个方法,export 
LD_PRELOAD=/usr/lib64/libbrpc.so  解决了问题
   但是在java线程退出的时候 就直接 core掉了。
   我现在按照 https://github.com/apache/brpc/issues/2266 
这个解决方案,将pthread_mutex_lock函数注释 掉。然后去掉export 
LD_PRELOAD=/usr/lib64/libbrpc.so是没有问题的。没搞清楚为什么使用export 
LD_PRELOAD=/usr/lib64/libbrpc.so 会有问题。
   


-- 
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] Use butil::ThreadLocal to store keytable (brpc)

2024-07-07 Thread via GitHub


chenBright commented on code in PR #2645:
URL: https://github.com/apache/brpc/pull/2645#discussion_r1612586070


##
src/bthread/types.h:
##
@@ -83,8 +83,17 @@ inline std::ostream& operator<<(std::ostream& os, 
bthread_key_t key) {
 }
 #endif  // __cplusplus
 
+namespace bthread{
+class KeyTableList;
+}
+
+namespace butil {
+template  class ThreadLocal;
+}
+
 typedef struct {
-pthread_mutex_t mutex;
+pthread_rwlock_t rwlock;
+butil::ThreadLocal* list;
 void* free_keytables;

Review Comment:
   我的意思是`void* list`,跟free_keytables的处理一样。这里是C代码,不能用模板吧。



-- 
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] Use butil::ThreadLocal to store keytable (brpc)

2024-07-07 Thread via GitHub


chenBright commented on code in PR #2645:
URL: https://github.com/apache/brpc/pull/2645#discussion_r1612686703


##
src/bthread/key.cpp:
##
@@ -226,14 +267,15 @@ void return_keytable(bthread_keytable_pool_t* pool, 
KeyTable* kt) {
 delete kt;
 return;
 }
-std::unique_lock mu(pool->mutex);
+pthread_rwlock_rdlock(>rwlock);
 if (pool->destroyed) {
-mu.unlock();
+pthread_rwlock_unlock(>rwlock);
 delete kt;
 return;
 }
-kt->next = (KeyTable*)pool->free_keytables;
-pool->free_keytables = kt;
+kt->next = pool->list->get()->keytable;
+pool->list->get()->keytable = kt;
+pthread_rwlock_unlock(>rwlock);

Review Comment:
   想了一下,应该先不用加这个逻辑吧。放回全局链表,到时候再取,都要加写锁,还会跟操作tls 
list有竞争,所以限制啥上限应该没必要。全局链表只保留预先reserve的功能就好了吧。
   
   或者不放回全局链表,而是直接delete。



-- 
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] Use butil::ThreadLocal to store keytable (brpc)

2024-07-07 Thread via GitHub


Huixxi merged PR #2645:
URL: https://github.com/apache/brpc/pull/2645


-- 
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] Use butil::ThreadLocal to store keytable (brpc)

2024-07-07 Thread via GitHub


MJY-HUST commented on PR #2645:
URL: https://github.com/apache/brpc/pull/2645#issuecomment-2212397182

   > 请问下按照这样做了设计之后,有具体的性能测试报告么?能够直观的显示这种改造在特定场景下带来的性能提升
   
   相同的负载下,修改前单链表维护的keytable,锁成为瓶颈。cpu被打满,sy时间占比高;
   修改后,解除了锁的瓶颈,cpu利用率降低,QPS提升了一倍。火焰图上和加锁/解锁操作对应的futex_wait\futex_wake耗时部分消失


-- 
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] Use butil::ThreadLocal to store keytable (brpc)

2024-07-07 Thread via GitHub


MJY-HUST commented on PR #2645:
URL: https://github.com/apache/brpc/pull/2645#issuecomment-2212394912

   > 请问下按照这样做了设计之后,有具体的性能测试报告么?能够直观的显示这种改造在特定场景下带来的性能提升
   
   修改前:
   
![image](https://github.com/apache/brpc/assets/52315061/a768eaf1-c245-4ea6-b618-b0f86bcaaf59)
   


-- 
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] variable.cpp error: ‘StringFlagDestructor’ does not name a type (brpc)

2024-07-06 Thread via GitHub


Huixxi closed issue #2679: variable.cpp   error:  ‘StringFlagDestructor’ does 
not name a type
URL: https://github.com/apache/brpc/issues/2679


-- 
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] brpc Stream导致普通RPC无法解析 (brpc)

2024-07-06 Thread via GitHub


Huixxi closed issue #2677: brpc Stream导致普通RPC无法解析
URL: https://github.com/apache/brpc/issues/2677


-- 
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] Bvar会丢失数据 (brpc)

2024-07-06 Thread via GitHub


Huixxi commented on issue #2682:
URL: https://github.com/apache/brpc/issues/2682#issuecomment-2212317073

   @serverglen 这个帅哥有空看下
   


-- 
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] Use butil::ThreadLocal to store keytable (brpc)

2024-07-06 Thread via GitHub


Huixxi commented on PR #2645:
URL: https://github.com/apache/brpc/pull/2645#issuecomment-2212314895

   请问下按照这样做了设计之后,有具体的性能测试报告么?能够直观的显示这种改造在特定场景下带来的性能提升


-- 
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 uninitialized local side of Socket (brpc)

2024-07-06 Thread via GitHub


Huixxi merged PR #2672:
URL: https://github.com/apache/brpc/pull/2672


-- 
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] Add debug log for Socket health check (brpc)

2024-07-06 Thread via GitHub


Huixxi merged PR #2673:
URL: https://github.com/apache/brpc/pull/2673


-- 
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] Add debug log for Socket health check (brpc)

2024-07-06 Thread via GitHub


Huixxi commented on PR #2673:
URL: https://github.com/apache/brpc/pull/2673#issuecomment-2212311550

   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 bug: switch between stream_rpc and baidu_std (brpc)

2024-07-06 Thread via GitHub


Huixxi merged PR #2678:
URL: https://github.com/apache/brpc/pull/2678


-- 
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] gdb_bthread_stack.py not work. (brpc)

2024-07-06 Thread via GitHub


Huixxi commented on issue #2674:
URL: https://github.com/apache/brpc/issues/2674#issuecomment-2212310641

   编译的时候加了-g么?


-- 
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] server中brpc::StreamWait卡在了thread::TaskGroup::sched_to (brpc)

2024-07-06 Thread via GitHub


GreateCode commented on issue #2680:
URL: https://github.com/apache/brpc/issues/2680#issuecomment-2212300609

   有道理,这样的话,一定时期内都是EAGAIN,while里就判定连接断开,然后return结束。
   但是server的连接资源怎么释放?如果sever配置了ServerOptions.idle_timeout_sec=100, 
那么超过100s后,server会把该连接释放吗?
   


-- 
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] add bzlmod support (brpc)

2024-07-06 Thread via GitHub


oathdruid commented on PR #2670:
URL: https://github.com/apache/brpc/pull/2670#issuecomment-2212296577

   any suggestion?


-- 
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 malloc dead lock cause by contention profiler (brpc)

2024-07-06 Thread via GitHub


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

   ### What problem does this PR solve?
   
   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](../../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] Questions about idle_timeout_sec of server (brpc)

2024-07-06 Thread via GitHub


chenBright commented on issue #2681:
URL: https://github.com/apache/brpc/issues/2681#issuecomment-2211811304

   In this case, the connection will be closed until all rpc requests are 
completed. Idle timeout mechanism only release the additional reference.


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



[I] 【rdma问题请教】Server收到Client通信后直接core (brpc)

2024-07-06 Thread via GitHub


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

   **Describe the bug (描述bug)**
   
在我的应用场景中,集成了brpc的多种操作,通过request_attachment或response_attachment收发,包含append、append_with_user_data、swap等多个动作,现尝试启用rdma,但还没有端到端跑通(brpc内置的rdma
 example已经跑通)
   
   **To Reproduce (复现方法)**
   
   同时在日志中,存在:
   
   W0706 14:41:19.870314 12521 rdma_endpoint.cpp:567] Fail to read Hello 
Message from client:Socket{id=102 fd=1057 addr=33.99.77.245:38992:19733} 
(0x0x7f0c83d23cc0) 33.99.77.245:38992
   
   **疑问**
   
   1. global initialize确认生效,尝试了在所有append_user_data的地方都register memeory,没有明显效果;
   2. 后面将所有append_user_data直接改成了append,直接copy,也还是会core;
   3. 可能导致core的原因有哪些?目前阻塞住了
   
   **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: dev-unsubscr...@brpc.apache.org.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] backup request可以支持下游错误率高于一定阈值时不生效吗? (brpc)

2024-07-06 Thread via GitHub


chenBright commented on issue #2668:
URL: https://github.com/apache/brpc/issues/2668#issuecomment-2211789986

   容灾方面是不是可以全面一点?
   (周期或者滑动窗口)统计请求的成功率,根据成功率可以做以下策略:
   1. lb选实例时,减少访问可用性弱的实例;
   2. 减少重试(包括backup request)。
   3. 其他,待补充。


-- 
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] server中brpc::StreamWait卡在了thread::TaskGroup::sched_to (brpc)

2024-07-06 Thread via GitHub


chenBright commented on issue #2680:
URL: https://github.com/apache/brpc/issues/2680#issuecomment-2211784543

   
StreamWrite没有返回网络错误,一直返回EAGAIN的话,应该是client挂了,但是server并没有感知到tcp连接断开,发送的数据没有收到client的ack,随后写不进去内核缓冲区后,就一直返回EAGAIN。


-- 
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 bug: switch between stream_rpc and baidu_std (brpc)

2024-07-06 Thread via GitHub


wwbmmm commented on PR #2678:
URL: https://github.com/apache/brpc/pull/2678#issuecomment-2211691354

   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: [I] variable.cpp error: ‘StringFlagDestructor’ does not name a type (brpc)

2024-07-05 Thread via GitHub


wasphin commented on issue #2679:
URL: https://github.com/apache/brpc/issues/2679#issuecomment-2211589472

   gflags 2.1 中有一处 namespace 的问题,在 2.2 中修复了,可以升级下
   
   
https://github.com/gflags/gflags/commit/408061b46974cc8377a8a794a048ecae359ad887


-- 
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] Bvar会丢失数据 (brpc)

2024-07-05 Thread via GitHub


icexin commented on issue #2682:
URL: https://github.com/apache/brpc/issues/2682#issuecomment-2210814523

   其中多维度指标的大概代码类似 
   ```
   MultiDimension> buckets_("ns", "name", {"le"})
   ```


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



[I] Bvar会丢失数据 (brpc)

2024-07-05 Thread via GitHub


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

   
我用mbvar来模拟prometheus的histogram指标,通过添加一个le的label来统计所有小于等于这个值的counter,其中+inf应该等于所有的请求数。但跑了一段时间后发现counter数并没有按照le的大小排序。如图
   
   
![image](https://github.com/apache/brpc/assets/2713364/875799b8-c0c5-4f3e-b6fe-f42731293271)
   


-- 
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.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] server中brpc::StreamWait卡在了thread::TaskGroup::sched_to (brpc)

2024-07-05 Thread via GitHub


GreateCode commented on issue #2680:
URL: https://github.com/apache/brpc/issues/2680#issuecomment-2210516950

   @jamesge 


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



[I] Questions about idle_timeout_sec of server (brpc)

2024-07-04 Thread via GitHub


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

   If the server side executes a rpc request for more than idle_timeout_sec, 
and the connection does not transmit any other rpc during this period, will the 
connection be closed in this case, causing the rpc request to fail?
   Does brpc have other mechanisms like keep alive to clean up unavailable 
connections instead of using idle_timeout_sec?


-- 
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.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 bug: switch between stream_rpc and baidu_std (brpc)

2024-07-04 Thread via GitHub


howarle commented on PR #2678:
URL: https://github.com/apache/brpc/pull/2678#issuecomment-2209903783

   这个似乎是UT的概率fail问题,main上的UT也是fail的


-- 
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] server中brpc::StreamWait卡在了thread::TaskGroup::sched_to (brpc)

2024-07-04 Thread via GitHub


GreateCode commented on issue #2680:
URL: https://github.com/apache/brpc/issues/2680#issuecomment-2208702573

   @chenBright @wwbmmm 大佬~


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



[I] server中brpc::StreamWait卡在了thread::TaskGroup::sched_to (brpc)

2024-07-04 Thread via GitHub


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

   **Describe the bug (描述bug)**
   server给client端发送几十个G的数据,期间client挂。
   StreamWait的due_time设置的是100ms(是错的,应该是时间点),但也不应该卡住吧。
   client挂和StreamWait卡住先后顺序不确定。
   栈信息如图,请大佬帮忙看看是什么原因。
   
   `
   while(1) {
int ec = brpc::StreamWrite();
if (ec == EINVAL) { return; }
   
if (ec == EAGAIN) {
 auto ret = brpc::StreamWait(stream_id, _time);
 if (ret == EINVAL) { return; }
}
   }
   `
   
   **To Reproduce (复现方法)**
   极难复现。
   
   **Expected behavior (期望行为)**
   
   
   **Versions (各种版本)**
   OS:ubuntu 20.04
   Compiler:clang
   brpc: 1.8.0
   protobuf:3.15
   
   **Additional context/screenshots (更多上下文/截图)**
   
   
![image](https://github.com/apache/brpc/assets/9795716/72a531de-fb39-42fe-8ac7-3def1f460c89)
   


-- 
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.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] 怀疑DynamicPartitionChannel+backup_request配合使用不再选择优先返回的下游了? (brpc)

2024-07-04 Thread via GitHub


yangkangka commented on issue #945:
URL: https://github.com/apache/brpc/issues/945#issuecomment-2208385094

   请求了10个sub_req,有1个触发重试,返回了11个sub_res


-- 
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] 应用程序使用brpc静态库(libbrpc.a)之后安装失败(依赖libc.so.6(GLIBC_PRIVATE)(64bit) ,使用brpc动态库没这个问题) (brpc)

2024-07-04 Thread via GitHub


joke-lee commented on issue #2410:
URL: https://github.com/apache/brpc/issues/2410#issuecomment-2208233520

   this spec work
   ```
   %define debug_package %{nil}
   %define _unpackaged_files_terminate_build 0
   Name: braft
   Version: 1.1.2
   Release: 1%{?dist}
   Summary: accesser
   License: Apache-2.0
   Group: Development/Languages/Other
   URL: http://gitlab.cmss.com/eos/accesser/accesser-src.git
   Source0: braft-1.1.2.tar.gz
   Provides: libbraft.so()(64bit)
   # https://access.redhat.com/solutions/519993
   %global  _filter_GLIBC_PRIVATE 1
   %global __filter_GLIBC_PRIVATE 1
   
   %if 0%{?fedora} >= 15 || 0%{?rhel} >= 8
   %global use_devtoolset 0
   %else
   %global use_devtoolset 1
   %endif
   
   %if 0%{?use_devtoolset}
   BuildRequires: devtoolset-8-gcc-c++
   %define __strip /opt/rh/devtoolset-8/root/usr/bin/strip
   %endif
   
   BuildRequires:  cmake
   BuildRequires:  gcc
   BuildRequires:  gcc-c++
   BuildRequires:  gflags-devel >= 2.1
   BuildRequires:  protobuf-devel >= 2.4
   BuildRequires:  leveldb-devel
   BuildRequires:  openssl-devel
   
   %description
   
   
   %package -n libbraft
   Summary: libbraft
   %description -n libbraft
   
   
   %prep
   %setup -q
   %build
   %if 0%{?use_devtoolset}
   . /opt/rh/devtoolset-8/enable
   %endif
   
   cd /yly/braft-1.1.2/build
   
   make -C ./ DESTDIR=%{buildroot} install
   
   %post -n libbraft
   echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_accesser.conf
   echo "/usr/local/lib64" >> /etc/ld.so.conf.d/usr_local_accesser.conf
   /sbin/ldconfig &> /dev/null
   
   %postun -n libbraft
   
   %define __spec_install_pre %{nil}
   %files -n libbraft
   /usr/local/include/braft/builtin_service.pb.h
   /usr/local/include/braft/cli.pb.h
   /usr/local/include/braft/enum.pb.h
   /usr/local/include/braft/errno.pb.h
   /usr/local/include/braft/file_service.pb.h
   /usr/local/include/braft/local_file_meta.pb.h
   /usr/local/include/braft/local_storage.pb.h
   /usr/local/include/braft/raft.pb.h
   /usr/local/include/braft/ballot.h
   /usr/local/include/braft/ballot_box.h
   /usr/local/include/braft/builtin_service_impl.h
   /usr/local/include/braft/cli.h
   /usr/local/include/braft/cli_service.h
   /usr/local/include/braft/closure_helper.h
   /usr/local/include/braft/closure_queue.h
   /usr/local/include/braft/configuration.h
   /usr/local/include/braft/configuration_manager.h
   /usr/local/include/braft/file_reader.h
   /usr/local/include/braft/file_service.h
   /usr/local/include/braft/file_system_adaptor.h
   /usr/local/include/braft/fsm_caller.h
   /usr/local/include/braft/fsync.h
   /usr/local/include/braft/lease.h
   /usr/local/include/braft/log.h
   /usr/local/include/braft/log_entry.h
   /usr/local/include/braft/log_manager.h
   /usr/local/include/braft/macros.h
   /usr/local/include/braft/memory_log.h
   /usr/local/include/braft/node.h
   /usr/local/include/braft/node_manager.h
   /usr/local/include/braft/protobuf_file.h
   /usr/local/include/braft/raft.h
   /usr/local/include/braft/raft_meta.h
   /usr/local/include/braft/raft_service.h
   /usr/local/include/braft/remote_file_copier.h
   /usr/local/include/braft/repeated_timer_task.h
   /usr/local/include/braft/replicator.h
   /usr/local/include/braft/route_table.h
   /usr/local/include/braft/snapshot.h
   /usr/local/include/braft/snapshot_executor.h
   /usr/local/include/braft/snapshot_throttle.h
   /usr/local/include/braft/storage.h
   /usr/local/include/braft/util.h
   /usr/local/lib/libbraft.a
   /usr/local/lib/libbraft.so
   
   ```


-- 
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 bug: switch between stream_rpc and baidu_std (brpc)

2024-07-03 Thread via GitHub


wwbmmm commented on PR #2678:
URL: https://github.com/apache/brpc/pull/2678#issuecomment-2207975487

   UT failed:
   
   ```
   brpc_streaming_rpc_unittest.cpp:254: Failure
   Expected equality of these values:
 0
 brpc::StreamWrite(request_stream, out)
   Which is: 11
   ```


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



[I] variable.cpp error: ‘StringFlagDestructor’ does not name a type (brpc)

2024-07-03 Thread via GitHub


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

   compiler step:
   1.  make build
   2.  cd build
   3.  cmake ../ -DWITH_GLOG=ON
   
   
![image](https://github.com/apache/brpc/assets/5895849/a8d8befb-9e5a-4b89-94cd-183b9d80ac02)
   


-- 
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.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 bug: switch between stream_rpc and baidu_std (brpc)

2024-07-03 Thread via GitHub


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

   ### What problem does this PR solve?
   
   Issue Number: https://github.com/apache/brpc/issues/2677
   
   Problem Summary: under `baidu_std`, server can not parse message when normal 
PRC and stream RPC arrive simultaneously 
   
   ### What is changed and the side effects?
   
   Changed: switch between `baidu_std` and `stream_rpc` in 
`InputMessenger::CutInputMessage`
   
   Side effects:
   - Performance effects(性能影响): Little or none
   
   - Breaking backward compatibility(向后兼容性): no
   
   ---
   ### 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](../../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



[I] Stream导致普通RPC无法解析 (brpc)

2024-07-03 Thread via GitHub


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

   **Describe the bug (描述bug)**
   当同一个brpc::Server中同时存在Stream和普通 RPC,普通RPC将无法解析,报错为:
   ```
   E20240703 08:42:11.077316 1409359 input_messenger.cpp:123] Fail to parse 
response from 127.0.0.1:12306 by streaming_rpc at client-side
   W20240703 08:42:11.077428 1409359 input_messenger.cpp:249] Close Socket{id=2 
fd=8 addr=127.0.0.1:12306:53862} (0x63114d00): absolutely wrong message
   E20240703 08:42:11.077787 1409308 stream_test.cc:138] Fail to send rpc 
[E22]Close Socket{id=2 fd=8 addr=127.0.0.1:12306:53862} (0x0x63114d00): 
absolutely wrong message
   ```
   
   之前也有issue讨论过这个问题,但最后不了了之 https://github.com/apache/brpc/issues/392
   
   **To Reproduce (复现方法)**
   
   最小复现代码:https://github.com/howarle/brpc_benchmark/blob/main/src/stream_test.cc
   复现率100%
   
   
   **Expected behavior (期望行为)**
   
   目前只能将普通RPC与stream分开两个server,但正常情况下同一个server也应当能够正常两种方案正常同时运行。
   
   **Versions (各种版本)**
   OS: Ubuntu 22.04
   Compiler: Clang++ 15.0.7
   brpc: 1.9.0
   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: dev-unsubscr...@brpc.apache.org.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] remove old rpcz directory even if program crash (brpc)

2024-07-02 Thread via GitHub


yanglimingcn merged PR #2610:
URL: https://github.com/apache/brpc/pull/2610


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



[I] GRPC python client can not read big response from brpc server (brpc)

2024-07-02 Thread via GitHub


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

   **Describe the bug (描述bug)**
   When server response a big value(more than 4096K), client will get error or 
hanging.
   
   **To Reproduce (复现方法)**
   
   I edited the example echo client/server, client send 8M message to server 
and receive response result success.
   
   
https://github.com/dashjay/brpc/commit/923555a205288ebe1e0c251a4e83506e2f7a1bb4
   
   Then when I generated a python grpc client and write a small case 
   ```
   from math import exp
   import grpc
   import echo_pb2
   import echo_pb2_grpc
   import random
   import time
   import string
   
   keySize = 4096
   size = keySize * 1024
   v_large = ''.join(random.choices(string.ascii_lowercase, k=size))
   bv_large = str.encode(v_large)
   
   options = [
   ('grpc.max_receive_message_length', 83804160),
   ('grpc.max_send_message_length', 83804160),
   ]
   
   channel = grpc.insecure_channel('0.0.0.0:8000', [])
   client = echo_pb2_grpc.EchoServiceStub(channel)
   req = echo_pb2.EchoRequest(message = bv_large)
   
   def send():
   resp = client.Echo(req, timeout=10)
   print(len(resp.message))
   
   
   if __name__ == '__main__':
   while True:
   try:
   send()
   except KeyboardInterrupt as e:
   break
   ```
   
   server run normally:
   ```
   I0703 12:02:46.774291  5379 755914244353 server.cpp:60] Received 
request[log_id=0] from 127.0.0.1:53151 to 127.0.0.1:8000: length(4194304) 
(attached=)
   I0703 12:02:46.787413  5379 755914244353 server.cpp:89] req: length(4194318) 
res: length(4194318)
   ```
   
   but grpc python client:
   ```
   bytedance@FY2MY2TWDK ~/D/c/b/e/echo_c++ 
(issue/server-no-buffer-for-grpc-client)> 
/Users/bytedance/.pyenv/versions/3.10.13/bin/python3 python_client.py
   Traceback (most recent call last):
 File "/codes/brpc/example/echo_c++/python_client.py", line 31, in 
   send()
 File "/codes/brpc/example/echo_c++/python_client.py", line 24, in send
   resp = client.Echo(req, timeout=10)
 File "/usr/lib/python3.10/site-packages/grpc/_channel.py", line 1181, in 
__call__
   return _end_unary_response_blocking(state, call, False, None)
 File "/usr/python3.10/site-packages/grpc/_channel.py", line 1006, in 
_end_unary_response_blocking
   raise _InactiveRpcError(state)  # pytype: disable=not-instantiable
   grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated 
with:
   status = StatusCode.INTERNAL
   details = "Received RST_STREAM with error code 3"
   debug_error_string = "UNKNOWN:Error received from peer  
{created_time:"2024-07-03T12:02:46.789109+08:00", grpc_status:13, 
grpc_message:"Received RST_STREAM with error code 3"}"
   >
   ```
   
   **Expected behavior (期望行为)**
   
   Get the echo value.
   
   I found on web and get this 
https://groups.google.com/g/grpc-io/c/3h-Q5Vjq5aU ,I suspect this has something 
to do with it
   
   
   
   **Versions (各种版本)**
   OS: Darwin FY2MY2TWDK 23.3.0 Darwin Kernel Version 23.3.0
   Compiler: `Apple clang version 15.0.0 (clang-1500.3.9.4)`
   brpc: `master`
   protobuf: ` protobuf: stable 27.1 (bottled)`
   
   **Additional context/screenshots (更多上下文/截图)**
   
   BRPC server interact with BRPC client good
   https://github.com/apache/brpc/assets/45532257/72a6ed42-c22b-4cb9-8b72-7c0c5ee5c790;>
   
   


-- 
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.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] backup request可以支持下游错误率高于一定阈值时不生效吗? (brpc)

2024-07-02 Thread via GitHub


icexin commented on issue #2668:
URL: https://github.com/apache/brpc/issues/2668#issuecomment-2205038609

   > 
我们是对backuprequest做了优化处理,只允许x%的请求发起backuprequest,并且backuprequest的阈值不是固定值,而是跟随延时的P99或者P95一起波动
   
   有代码吗?这个需求挺常见的


-- 
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] server 端通过channel 访问其他服务,内存持续缓慢上涨,疑似内存泄漏 (brpc)

2024-07-02 Thread via GitHub


qhren closed issue #2633: server 端通过channel 访问其他服务,内存持续缓慢上涨,疑似内存泄漏
URL: https://github.com/apache/brpc/issues/2633


-- 
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] brpc退出时卡死 (brpc)

2024-07-02 Thread via GitHub


TousakaRin closed issue #2665: brpc退出时卡死
URL: https://github.com/apache/brpc/issues/2665


-- 
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] socket: fix potential double close (brpc)

2024-06-24 Thread via GitHub


chenBright merged PR #2663:
URL: https://github.com/apache/brpc/pull/2663


-- 
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] Is there already any plan about switch bazel workspace to bzlmod? (brpc)

2024-06-24 Thread via GitHub


chenBright commented on issue #2654:
URL: https://github.com/apache/brpc/issues/2654#issuecomment-2185814847

   Sorry, I'm not familiar with bazel.
   
   @wwbmmm Is there anyone familiar with bazel who can review it?


-- 
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] brpc退出时卡死 (brpc)

2024-06-23 Thread via GitHub


zhangyachen commented on issue #2665:
URL: https://github.com/apache/brpc/issues/2665#issuecomment-2185473446

   
这个问题解决了,当我把上游换成grpc框架时,还是会出现不能退出的问题,确定是我代码写的有问题。后来从[server.md](https://github.com/apache/brpc/blob/master/docs/cn/server.md#%E5%81%9C%E6%AD%A2)中找到了答案,这里面提到:
   > 如果你的server“退不掉”,很有可能是由于某个检索线程没结束或忘记调用done了。
   
   我的brpc server代码是调用一个异步函数,这个异步函数在程序退出时会返回error。伪代码是:
   ```c++
   void InferenceServiceImpl::ModelInfer(google::protobuf::RpcController* 
cntl_base,
 const inference::ModelInferRequest* request,
 inference::ModelInferResponse* response,
 google::protobuf::Closure* done) {
 brpc::ClosureGuard done_guard(done);
 brpc::Controller* cntl = static_cast(cntl_base);
 TRITONSERVER_Error* err = nullptr;
   
 //将done保存起来,在回调函数中使用
 State* state = StateNew(done, response, cntl);
 // 回调函数
err = TRITONSERVER_InferenceRequestSetResponseCallback(
   irequest, allocator_,
   >alloc_payload_ /* response_allocator_userp */,
   InferResponseComplete, reinterpret_cast(state));
 // 异步函数
 if (err == nullptr) {
   err = TRITONSERVER_ServerInferAsync(tritonserver_.get(), irequest, 
nullptr);
 }
 if (err != nullptr) {
   int brpc_status;
   BrpcStatusUtil::Create(_status, err);
   std::string error_msg = berror(brpc_status);
   cntl->SetFailed(brpc_status, "%s", error_msg.c_str());
   TRITONSERVER_ErrorDelete(err);
   
   // 新添加的
   return;
 }
   
 done_guard.release();
   }
   ```
   
   
当异步函数TRITONSERVER_ServerInferAsync报错时,没有return导致brpc::ClosureGuard没有调用done->Run();


-- 
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] brpc退出时卡死 (brpc)

2024-06-21 Thread via GitHub


zhangyachen commented on issue #2665:
URL: https://github.com/apache/brpc/issues/2665#issuecomment-2177413389

   > client 
也是brpc写的吗,正常流程是你发送kill之后,server拒绝接受新的连接,同时为后续所有的rpc都返回ELOGOFF这个错误,brpc的client在收到这个错误之后会把对应socket摘除。
   
   client是百度的java版brpc,https://github.com/baidu/starlight


-- 
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] brpc退出时卡死 (brpc)

2024-06-21 Thread via GitHub


TousakaRin commented on issue #2665:
URL: https://github.com/apache/brpc/issues/2665#issuecomment-2177375145

   client 
也是brpc写的吗,正常流程是你发送kill之后,server拒绝接受新的连接,同时为后续所有的rpc都返回ELOGOFF这个错误,brpc的client在收到这个错误之后会把对应socket摘除。


-- 
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] 连接处于CLOSE_WAIT状态导致健康检查失败 (brpc)

2024-06-18 Thread via GitHub


icexin commented on issue #2662:
URL: https://github.com/apache/brpc/issues/2662#issuecomment-2175883103

   这边是客户端处于close_wait状态,我们用的是同步rpc,应该rpc很快就处理完了。服务端后来起来后,客户端也因为这个状态一直健康检查失败


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



[I] brpc退出时卡死 (brpc)

2024-06-18 Thread via GitHub


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

   **Describe the bug (描述bug)**
   在程序退出时,brpc卡在Join的函数不继续执行。
   
   **To Reproduce (复现方法)**
   程序退出时会调用该方法:
   ```
   TRITONSERVER_Error*
   BRPCServer::Stop()
   {
 if (!running_) {
   return TRITONSERVER_ErrorNew(
   TRITONSERVER_ERROR_UNAVAILABLE, "BRPC server is not running.");
 }
   
 // @TODO 检查brpc server如何shutdown
 std::cout << "ready to stop brpc server" << std::endl;
 brpc_server_->Stop(0);
 std::cout << "ready to join brpc server" << std::endl;
 brpc_server_->Join();
 std::cout << "stop brpc server" << std::endl;
   
 running_ = false;
   
 return nullptr;  // success
   }
   ```
   
   加了三个debug日志,发现卡死在Join上了。
   
   场景是上游有**多个client创建多个链接**到brpc server。**我发现当没有流量到brpc 
server时,就可以正常退出**,打印stop brpc server,但是当上游还有流量到brpc server,我kill brpc 
server进程时,就会出现卡死现象。
   
   
   **Expected behavior (期望行为)**
   正常退出。
   
   **Versions (各种版本)**
   OS: Ubuntu 20.04.5 LTS (Focal Fossa)
   Compiler:  
   brpc:   master代码
   protobuf:  3.16
   
   **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: dev-unsubscr...@brpc.apache.org.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] 连接处于CLOSE_WAIT状态导致健康检查失败 (brpc)

2024-06-17 Thread via GitHub


chenBright commented on issue #2662:
URL: https://github.com/apache/brpc/issues/2662#issuecomment-2174803799

   另外,服务端没起来,健康检查也不会成功吧。


-- 
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] 连接处于CLOSE_WAIT状态导致健康检查失败 (brpc)

2024-06-17 Thread via GitHub


chenBright commented on issue #2662:
URL: https://github.com/apache/brpc/issues/2662#issuecomment-2174800981

   看着像是是还有rpc没有结束。框架内部要等到连接上全部rpc结束了,才会close fd,然后进行健康检查。


-- 
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] 连接处于CLOSE_WAIT状态导致健康检查失败 (brpc)

2024-06-17 Thread via GitHub


icexin commented on issue #2662:
URL: https://github.com/apache/brpc/issues/2662#issuecomment-2174727365

   对,在我们手动重启之前一直是CLOSE_WAIT状态


-- 
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 tcp connect interrupt (brpc)

2024-06-17 Thread via GitHub


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

   ### What problem does this PR solve?
   
   Issue Number:
   
   Problem Summary:
   
   tcp_connect被中断之后,返回结果是有问题的:
   1. `bthread_timed_connect / 
bthread_connect`:`butex_wait`返回0,errno等于`EWOULDBLOCK`或者`EINTR`,最后tcp_connect返回一个未连接成功的socket
 fd。
   2. `pthread_timed_connect `:返回-1,errno等于`EINTR`。
   
   ### What is changed and the side effects?
   
   Changed:
   
   当errno等于`EWOULDBLOCK`或者`EINTR`,`pthread_fd_wait / 
bthread_fd_wait`继续wait到连接成功或者失败。
   
   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](../../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] 连接处于CLOSE_WAIT状态导致健康检查失败 (brpc)

2024-06-17 Thread via GitHub


chenBright commented on issue #2662:
URL: https://github.com/apache/brpc/issues/2662#issuecomment-2173630016

   CLOSE_WAIT状态持续很久吗?


-- 
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] 连接处于CLOSE_WAIT状态导致健康检查失败 (brpc)

2024-06-17 Thread via GitHub


chenBright commented on issue #2662:
URL: https://github.com/apache/brpc/issues/2662#issuecomment-2173629429

   有这个日志吗?
   
https://github.com/apache/brpc/blob/2e183187bcbccc39c7da8dde2a98d02a7a031279/src/brpc/socket.cpp#L2564-L2567


-- 
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] socket: fix potential double close (brpc)

2024-06-15 Thread via GitHub


wwbmmm commented on PR #2663:
URL: https://github.com/apache/brpc/pull/2663#issuecomment-2169182296

   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: [I] brpc异步server使用方式 (brpc)

2024-06-14 Thread via GitHub


zhangyachen closed issue #2657: brpc异步server使用方式
URL: https://github.com/apache/brpc/issues/2657


-- 
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] leveldb已经老旧化,是否考虑切到rocksdb (brpc)

2024-06-13 Thread via GitHub


cdjingit closed issue #2652: leveldb已经老旧化,是否考虑切到rocksdb
URL: https://github.com/apache/brpc/issues/2652


-- 
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] bvar::PassiveStatus 无法暴露指标 (brpc)

2024-06-13 Thread via GitHub


cdjingit closed issue #2653: bvar::PassiveStatus 无法暴露指标
URL: https://github.com/apache/brpc/issues/2653


-- 
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 h2 rpc_dump memory leak bug (brpc)

2024-06-12 Thread via GitHub


wwbmmm merged PR #2661:
URL: https://github.com/apache/brpc/pull/2661


-- 
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] Use butil::ThreadLocal to store keytable (brpc)

2024-06-12 Thread via GitHub


wwbmmm commented on PR #2645:
URL: https://github.com/apache/brpc/pull/2645#issuecomment-2164345475

   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] Support connect on socket create (brpc)

2024-06-12 Thread via GitHub


wwbmmm merged PR #2574:
URL: https://github.com/apache/brpc/pull/2574


-- 
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] mbvar 如何通过 LatencyRecorder 获取平均耗时 (brpc)

2024-06-12 Thread via GitHub


wwbmmm commented on issue #2660:
URL: https://github.com/apache/brpc/issues/2660#issuecomment-2164340496

   百度内部好像是用的 service_latency{valid="false",quantile="avg"}


-- 
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] Support proxy and generic call of baidu protocol (brpc)

2024-06-12 Thread via GitHub


wwbmmm merged PR #2629:
URL: https://github.com/apache/brpc/pull/2629


-- 
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] bvar::PassiveStatus 无法暴露指标 (brpc)

2024-06-12 Thread via GitHub


j05070415 commented on issue #2653:
URL: https://github.com/apache/brpc/issues/2653#issuecomment-2164288552

   谢谢,您的邮件我已收到!


-- 
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] bvar::PassiveStatus 无法暴露指标 (brpc)

2024-06-12 Thread via GitHub


cdjingit commented on issue #2653:
URL: https://github.com/apache/brpc/issues/2653#issuecomment-2164287507

   > 你好,咨询一下 PassiveStatusstd::string 设计初衷是什么呢,或者针对哪些场景? 根据 
[bvar::PassiveStatus](https://github.com/apache/brpc/blob/master/docs/cn/bvar_c%2B%2B.md#bvarpassivestatus)
 文档,process_username 不能作为指标暴露出去,这个特化模板正确使用方法是什么呢?
   文档中描述的场景比较清楚。不能暴露的原因,如上面所说,因为系统默认已经有一个process_username对应的bvar了


-- 
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 h2 rpc_dump memory leak bug (brpc)

2024-06-12 Thread via GitHub


yanglimingcn commented on PR #2661:
URL: https://github.com/apache/brpc/pull/2661#issuecomment-2164228545

   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 h2 rpc_dump memory leak bug (brpc)

2024-06-12 Thread via GitHub


GreateCode commented on PR #2661:
URL: https://github.com/apache/brpc/pull/2661#issuecomment-2164225012

   @wwbmmm 合下?


-- 
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 h2 rpc_dump memory leak bug (brpc)

2024-06-12 Thread via GitHub


GreateCode commented on PR #2661:
URL: https://github.com/apache/brpc/pull/2661#issuecomment-2164211696

   @chenBright 


-- 
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] socket: fix potential double close (brpc)

2024-06-12 Thread via GitHub


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

   ### What problem does this PR solve?
   
   Problem Summary:
   
   `_fd` should be reset if `ResetFileDescriptor` is going to return -1, 
otherwise the fd will be closed in callers like `CheckConnectedAndKeepWrite` or 
`Server::StartInernal` and socket lifecycle methods like `BeforeRecycled` or 
`WaitAndReset`.
   
   
   ### What is changed and the side effects?
   
   Changed:
   
   Side effects:
   - Performance effects(性能影响):
   No
   - Breaking backward compatibility(向后兼容性): 
   No
   ---
   ### 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](../../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



[I] 连接处于CLOSE_WAIT状态导致健康检查失败 (brpc)

2024-06-12 Thread via GitHub


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

   **Describe the bug (描述bug)**
   服务端的一次宕机后,客户端就一直因为检查检查失败导致rpc失败,报错 `[E112]Fail to select server from 
xxx`。在出问题的机器上可以看到连接处于CLOSE_WAIT状态。
   
   
   
   **Versions (各种版本)**
   OS: ubuntu 20.04
   Compiler: clang-8
   brpc: 1.8.0
   protobuf: 3.15.8
   
   **Additional context/screenshots (更多上下文/截图)**
   
   https://github.com/apache/brpc/assets/2713364/739e96bc-ff5a-452d-abdc-21ecf4069d99;>
   https://github.com/apache/brpc/assets/2713364/b35e8969-56c3-46ee-990e-3a5eb02f9489;>
   
   


-- 
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.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 h2 rpc_dump mem leak bug (brpc)

2024-06-11 Thread via GitHub


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

   ### What problem does this PR solve?
   
   Issue Number:
   
   Problem Summary:
   **h2 rpc_dump时 内存泄漏**。
   
   
具体是http和h2都走ProcessHttpRequest方法,在处理rpc_dump时,先AskToBeSampled创建堆对象再判is_http2,若是http2无释放堆对象逻辑。
   
   发压cmd:rpc_press -protocol=h2 
   
   ### What is changed and the side effects?
   Changed:
   h2 req不做AskToBeSampled
   
   修复前:
   
![image](https://github.com/apache/brpc/assets/9795716/2c37f39a-4282-42e4-b7bc-aae025bae5fc)
   
![image](https://github.com/apache/brpc/assets/9795716/37f56855-89be-42a0-9710-5909a6589288)
   
![image](https://github.com/apache/brpc/assets/9795716/35f679b4-a788-4600-98e3-d816b484a909)
   
![image](https://github.com/apache/brpc/assets/9795716/d7bc0f88-99f6-4e54-85ce-95c3a5a4e8fc)
   
   
[brpc_h2_rpc_dump_mem_leak_bug.pdf](https://github.com/user-attachments/files/15798428/brpc_h2_rpc_dump_mem_leak_bug.pdf)
   
   
   修复后:
   
![image](https://github.com/apache/brpc/assets/9795716/e826f4bb-1e84-408d-b452-579ad6d48bcb)
   
![image](https://github.com/apache/brpc/assets/9795716/ddb6b167-0ecf-4716-8dc4-9367a250c3fe)
   
![image](https://github.com/apache/brpc/assets/9795716/a2036e8f-2fa1-44da-8e5d-6078ab02cbce)
   
   
[brpc_h2_rpc_dump_mem_leak_fixed.pdf](https://github.com/user-attachments/files/15798432/brpc_h2_rpc_dump_mem_leak_fixed.pdf)
   
   
   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](../../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: [PR] Use butil::ThreadLocal to store keytable (brpc)

2024-06-11 Thread via GitHub


MJY-HUST commented on code in PR #2645:
URL: https://github.com/apache/brpc/pull/2645#discussion_r1635199601


##
src/bthread/key.cpp:
##
@@ -204,14 +205,57 @@ class BAIDU_CACHELINE_ALIGNMENT KeyTable {
 SubKeyTable* _subs[KEY_1STLEVEL_SIZE];
 };
 
+class KeyTableList {
+public:
+KeyTableList() {
+keytable = NULL;
+}
+~KeyTableList() {
+bthread::TaskGroup* g = bthread::tls_task_group;
+bthread::KeyTable* old_kt = bthread::tls_bls.keytable;
+while (keytable) {
+bthread::KeyTable* kt = keytable;
+keytable = kt->next;
+bthread::tls_bls.keytable = kt;
+if (g) {
+g->current_task()->local_storage.keytable = kt;
+}
+delete kt;
+if (old_kt == kt) {
+old_kt = NULL;
+}
+g = bthread::tls_task_group;
+}
+bthread::tls_bls.keytable = old_kt;
+if(g) {
+g->current_task()->local_storage.keytable = old_kt;
+}
+}
+KeyTable* keytable;

Review Comment:
   改成了struct



-- 
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] Use butil::ThreadLocal to store keytable (brpc)

2024-06-11 Thread via GitHub


MJY-HUST commented on PR #2645:
URL: https://github.com/apache/brpc/pull/2645#issuecomment-2161206047

   > 对这个场景有点疑问,如果bthread生命周期很短,为什么还要使用bthread_local变量呢,用pthread 
local、局部变量或者通过函数参数传递不行吗
   
   场景是:使用brpc框架通信,server下面接着一个数据库。使用bthread 
pool用于处理数据库的查询请求,数据库内部的实现使用了bthread级别的锁和tls来避免阻塞线程。数据库内部需要使用一些thread_local(bthread_local)来保证其一致性。
   
并不是所有的条件下bthread的生命周期都会很短,但是在一些场景下,如果数据都在缓存中,那么一个bthread的生命周期就会很短,此时单链表结构的keytable
 pool管理模式就会出现瓶颈。


-- 
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] Use butil::ThreadLocal to store keytable (brpc)

2024-06-11 Thread via GitHub


MJY-HUST commented on code in PR #2645:
URL: https://github.com/apache/brpc/pull/2645#discussion_r1635186376


##
src/bthread/key.cpp:
##
@@ -226,14 +270,16 @@ void return_keytable(bthread_keytable_pool_t* pool, 
KeyTable* kt) {
 delete kt;
 return;
 }
-std::unique_lock mu(pool->mutex);
+pthread_rwlock_rdlock(>rwlock);
 if (pool->destroyed) {
-mu.unlock();
+pthread_rwlock_unlock(>rwlock);
 delete kt;
 return;
 }
-kt->next = (KeyTable*)pool->free_keytables;
-pool->free_keytables = kt;
+auto list = (butil::ThreadLocal*)pool->list;

Review Comment:
   
是不会返回给free_keytables了。free_keytables的大小是根据server.option的reserved_thread_local_data变量设置的,默认为0。
   不过这里的线程指的应该只是一个bthread_keytable_pool_t pool所对应的server的brpc_worker 
threads,而不是普通的pthread。
   所以相比使用单链表管理,如果brpc_worker 
thread是公平调度的话,内部的butil::ThreadLocal维护的链表长度应该是比使用一个单链表来说要短,但是性能会更好,因为同样存在回收机制,内存不会多太多。



-- 
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] Support connect on socket create (brpc)

2024-06-11 Thread via GitHub


chenBright commented on PR #2574:
URL: https://github.com/apache/brpc/pull/2574#issuecomment-2159878088

   @wwbmmm done,rebase解决冲突。


-- 
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] 支持bRPC网关转发baidu协议请求的功能 (brpc)

2024-06-10 Thread via GitHub


chenBright commented on issue #2405:
URL: https://github.com/apache/brpc/issues/2405#issuecomment-2159708781

   稍微修改了一下原来的描述。


-- 
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] 支持bRPC网关转发baidu协议请求的功能 (brpc)

2024-06-10 Thread via GitHub


chenBright commented on issue #2405:
URL: https://github.com/apache/brpc/issues/2405#issuecomment-2159705777

   嗯嗯,网关只转发baidu协议请求的话,是不需要json、pb互转的。
   
   
扩展一下,网关要支持多语言(php、nodejs、python等)接入baidu协议的brpc服务的话,client的payload一般使用json,网关负责服务发现和转发payload,brpc服务需要支持json、pb互转的能力。


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



  1   2   3   4   5   6   7   8   9   10   >