We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug (描述bug) 使用优雅退出时,Server退出后,cleanup_pthread清理keytable时,进程会coredump。
To Reproduce (复现方法)
graceful_quit_on_sigterm
bthread_setspecific
Server::RunUntilAskedToQuit
分析
butil::thread_atexit(bthread::cleanup_pthread, kt)
Server::Join
Expected behavior (期望行为) 优雅退出时能只清理pthread创建的keytable,bthread创建的keytable不需要在cleanup_pthread中清理,这些keytable会在return_keytable或者bthread_keytable_pool_destroy中清理。
Versions (各种版本) OS: Ubuntu 16.04.4 Compiler: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11) brpc: 1.0.0 protobuf: 2
Additional context/screenshots (更多上下文/截图)
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Describe the bug (描述bug)
使用优雅退出时,Server退出后,cleanup_pthread清理keytable时,进程会coredump。
To Reproduce (复现方法)
graceful_quit_on_sigterm
打开优雅退出功能;bthread_setspecific
生成协程变量;Server::RunUntilAskedToQuit
。分析
bthread_setspecific
生成协程变量,并通过butil::thread_atexit(bthread::cleanup_pthread, kt)
保存worker线程上第一个创建的keytable。请求结束后,该协程的keytable会回收到Server的keytable_pool的free_keytables中。Server::Join
会清理keytable_pool的free_keytables,会delete第1步创建的keytable。worker线程退出时,bthread::cleanup_pthread也会delete这个keytable,造成double delete出coredump。Expected behavior (期望行为)
优雅退出时能只清理pthread创建的keytable,bthread创建的keytable不需要在cleanup_pthread中清理,这些keytable会在return_keytable或者bthread_keytable_pool_destroy中清理。
Versions (各种版本)
OS: Ubuntu 16.04.4
Compiler: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11)
brpc: 1.0.0
protobuf: 2
Additional context/screenshots (更多上下文/截图)
The text was updated successfully, but these errors were encountered: