Yingchun Lai has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/18867 )

Change subject: [threadpool] Fix unsafe behaviour when SchedulerThread shutdown
......................................................................

[threadpool] Fix unsafe behaviour when SchedulerThread shutdown

When shutting down a thread pool with SchedulerThread, thread pool's variable
'scheduler_' is deleted and set to nullptr, at the same time, if thread pool
token is not shutdown and a task is scheduled on the token, this may cause
a coredump because 'scheduler_' is a nullptr.

This patch fixes the bug, adding a mutex lock in class 'ThreadPool' to
protect variable 'scheduler_'.

Change-Id: I021422f7e51e1007c5bdbc877ab445f70ba12357
Reviewed-on: http://gerrit.cloudera.org:8080/18867
Tested-by: Kudu Jenkins
Reviewed-by: Yingchun Lai <[email protected]>
---
M src/kudu/util/threadpool-test.cc
M src/kudu/util/threadpool.cc
M src/kudu/util/threadpool.h
3 files changed, 133 insertions(+), 51 deletions(-)

Approvals:
  Kudu Jenkins: Verified
  Yingchun Lai: Looks good to me, approved

--
To view, visit http://gerrit.cloudera.org:8080/18867
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I021422f7e51e1007c5bdbc877ab445f70ba12357
Gerrit-Change-Number: 18867
Gerrit-PatchSet: 19
Gerrit-Owner: Yuqi Du <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Yifan Zhang <[email protected]>
Gerrit-Reviewer: Yingchun Lai <[email protected]>
Gerrit-Reviewer: Yuqi Du <[email protected]>

Reply via email to