提交 2a111053 编写于 作者: Z zhao liwei 提交者: Yingchun Lai

fix: fix the bug of deadlock in info collector in onebox environment (#404)

上级 92a55b23
......@@ -86,6 +86,12 @@
name = default
partitioned = false
worker_priority = THREAD_xPRIORITY_NORMAL
# The worker count in THREAD_POOL_DEFAULT must be >= 5.
# Because in info collector server, there are four timer tasks(LPC_PEGASUS_APP_STAT_TIMER, LPC_PEGASUS_STORAGE_SIZE_STAT_TIMER,
# LPC_DETECT_AVAILABLE and LPC_PEGASUS_CAPACITY_UNIT_STAT_TIMER). Each of these timer tasks occupies a thread in THREAD_POOL_DEFAULT.
# Each of these timer tasks calls remote procedure to meta server(which produce a callback), and waits for the rpc's callback to execute.
# If the worker_count <= 4, all of these threads are occupied by these timer tasks. so their rpc's callbacks can't get a thread to run.
# it comes to be a deadlock(timer task wait for rpc's callback to execute, and rpc's callback wait for the timer task to release the thread).
worker_count = 8
[threadpool.THREAD_POOL_REPLICATION]
......
......@@ -40,7 +40,13 @@
[threadpool.THREAD_POOL_DEFAULT]
name = default
worker_count = 2
# The worker count in THREAD_POOL_DEFAULT must be >= 5.
# Because in info collector server, there are four timer tasks(LPC_PEGASUS_APP_STAT_TIMER, LPC_PEGASUS_STORAGE_SIZE_STAT_TIMER,
# LPC_DETECT_AVAILABLE and LPC_PEGASUS_CAPACITY_UNIT_STAT_TIMER). Each of these timer tasks occupies a thread in THREAD_POOL_DEFAULT.
# Each of these timer tasks calls remote procedure to meta server(which produce a callback), and waits for the rpc's callback to execute.
# If the worker_count <= 4, all of these threads are occupied by these timer tasks. so their rpc's callbacks can't get a thread to run.
# it comes to be a deadlock(timer task wait for rpc's callback to execute, and rpc's callback wait for the timer task to release the thread).
worker_count = 5
[threadpool.THREAD_POOL_REPLICATION]
name = replica
......
......@@ -11,8 +11,6 @@
namespace pegasus {
namespace server {
DEFINE_TASK_CODE(LPC_PEGASUS_COLLECTOR_TIMER, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT)
class info_collector_app : public ::dsn::service_app
{
public:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册