You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Yuqi Du (Code Review)" <ge...@cloudera.org> on 2022/10/07 12:38:11 UTC

[kudu-CR] [threadpool] Fix unsafe behaviour when SchedulerThread shutdown

Hello Tidy Bot, Alexey Serbin, Yingchun Lai, Yifan Zhang, Kudu Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/18867

to look at the new patch set (#17).

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
---
M src/kudu/util/threadpool-test.cc
M src/kudu/util/threadpool.cc
M src/kudu/util/threadpool.h
3 files changed, 112 insertions(+), 45 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/67/18867/17
-- 
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: newpatchset
Gerrit-Change-Id: I021422f7e51e1007c5bdbc877ab445f70ba12357
Gerrit-Change-Number: 18867
Gerrit-PatchSet: 17
Gerrit-Owner: Yuqi Du <sh...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Yifan Zhang <ch...@163.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
Gerrit-Reviewer: Yuqi Du <sh...@gmail.com>