You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2020/09/25 08:17:39 UTC

[GitHub] [incubator-brpc] yqynju opened a new issue #1256: bvar, bvar::LatencyRecorder coredump

yqynju opened a new issue #1256:
URL: https://github.com/apache/incubator-brpc/issues/1256


   **Describe the bug (描述bug)**
   
   bvar::LatencyRecorder 使用时,记录时延:
   g_latency_recorder << cntl.latency_us();
   
   多线程并发,会coredump。
   堆栈如下:
   2020-09-25 10:28:03|kr_server|FATAL|/bvar/detail/agent_group.h:133] Check failed: false. Invalid id=-1
   #0 0x55d30b5f6ffb bvar::detail::AgentGroup<>::get_or_create_tls_agent()
   #1 0x55d30b5f727f bvar::IntRecorder::operator<<()
   #2 0x55d30b5f3eac bvar::LatencyRecorder::operator<<()
   #3 0x55d30b54317e xxWrapper::xxx()    //代码为: g_latency_recorder << cntl.latency_us(); 未加锁
   #4 0x55d30b543803 xxWrapper::xxx()
   #5 0x55d30b5460b5 std::_Function_handler<>::_M_invoke()
   #6 0x55d30b53e478 segment::ThreadPool::runInThread()
   #7 0x7ffa39b50900 <unknown>
   #8 0x7ffa39daae45 start_thread
   #9 0x7ffa392b7add __clone
   
   
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] yqynju commented on issue #1256: bvar, bvar::LatencyRecorder coredump

Posted by GitBox <gi...@apache.org>.
yqynju commented on issue #1256:
URL: https://github.com/apache/incubator-brpc/issues/1256#issuecomment-698795767


   是异步场景,但是g_latency_recorder是全局的,服务就异常退出了,显示的日志信息就是上面的堆栈。
   
   你意思是,服务挂掉,然后异步任务会触发这个堆栈,并非是这个堆栈引起服务挂掉,是吗?


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] TousakaRin commented on issue #1256: bvar, bvar::LatencyRecorder coredump

Posted by GitBox <gi...@apache.org>.
TousakaRin commented on issue #1256:
URL: https://github.com/apache/incubator-brpc/issues/1256#issuecomment-698794438






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] yqynju closed issue #1256: bvar, bvar::LatencyRecorder coredump

Posted by GitBox <gi...@apache.org>.
yqynju closed issue #1256:
URL: https://github.com/apache/incubator-brpc/issues/1256


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] TousakaRin commented on issue #1256: bvar, bvar::LatencyRecorder coredump

Posted by GitBox <gi...@apache.org>.
TousakaRin commented on issue #1256:
URL: https://github.com/apache/incubator-brpc/issues/1256#issuecomment-698799026


   大概率是,不过我们出现这个FATAL的时候,都是在主动重启服务时出现。快速的修复办法就是new 出来这个g_latency_recorder,然后不析构。


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] yqynju commented on issue #1256: bvar, bvar::LatencyRecorder coredump

Posted by GitBox <gi...@apache.org>.
yqynju commented on issue #1256:
URL: https://github.com/apache/incubator-brpc/issues/1256#issuecomment-698795767


   是异步场景,但是g_latency_recorder是全局的,服务就异常退出了,显示的日志信息就是上面的堆栈。
   
   你意思是,服务挂掉,然后异步任务会触发这个堆栈,并非是这个堆栈引起服务挂掉,是吗?


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] yqynju commented on issue #1256: bvar, bvar::LatencyRecorder coredump

Posted by GitBox <gi...@apache.org>.
yqynju commented on issue #1256:
URL: https://github.com/apache/incubator-brpc/issues/1256#issuecomment-699746749


   问题是由于其他原因导致,异步会报这个错误,误导了判断。


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] TousakaRin commented on issue #1256: bvar, bvar::LatencyRecorder coredump

Posted by GitBox <gi...@apache.org>.
TousakaRin commented on issue #1256:
URL: https://github.com/apache/incubator-brpc/issues/1256#issuecomment-698794438


   按照以往的经验,这个问题是调用 `g_latency_recorder << cntl.latency_us();` 时,g_latency_recorder 已经析构造成的。
   常见的场景就是服务重启的时候,一些不join的异步rpc,其异步回调里访问了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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org