Yingchun Lai has posted comments on this change. ( http://gerrit.cloudera.org:8080/18674 )
Change subject: [threadpool] Fix scheduler thread a coredump bug ...................................................................... Patch Set 16: (5 comments) http://gerrit.cloudera.org:8080/#/c/18674/16/src/kudu/util/threadpool-test.cc File src/kudu/util/threadpool-test.cc: http://gerrit.cloudera.org:8080/#/c/18674/16/src/kudu/util/threadpool-test.cc@153 PS16, Line 153: token->InitWeakPtr(token); I found it introduce too many complex when we use it.. http://gerrit.cloudera.org:8080/#/c/18674/16/src/kudu/util/threadpool.h File src/kudu/util/threadpool.h: http://gerrit.cloudera.org:8080/#/c/18674/16/src/kudu/util/threadpool.h@163 PS16, Line 163: std::shared_ptr< How about cancel and remove the tokens before exit? Then it can be destroyed safely. http://gerrit.cloudera.org:8080/#/c/18674/16/src/kudu/util/threadpool.h@163 PS16, Line 163: thread_pool_token_ nit: for struct, no need to add '_' suffix. http://gerrit.cloudera.org:8080/#/c/18674/16/src/kudu/util/threadpool.h@187 PS16, Line 187: Default: 100ms. : // Use ThreadPoolBuilder.set_schedule_period_ms() setting it. I don't think it's necessary to add these coments, the default value may be outdate, you can assign it here like `const uint32_t schedule_period_ms_ == 100;`, code is better than comments. Comment how to set it is duplicate too, the setter is in public scope, user can find it there earlier than private scope here. http://gerrit.cloudera.org:8080/#/c/18674/16/src/kudu/util/threadpool.h@199 PS16, Line 199: // kv pair means absolute time should execute the SchedulerTask. Better to give a better name than explain in comments. -- To view, visit http://gerrit.cloudera.org:8080/18674 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie5bc5511a745f3dc12dfe1a6a1813ece41ccc2a8 Gerrit-Change-Number: 18674 Gerrit-PatchSet: 16 Gerrit-Owner: Yuqi Du <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Tidy Bot (241) Gerrit-Reviewer: Yingchun Lai <[email protected]> Gerrit-Reviewer: Yuqi Du <[email protected]> Gerrit-Comment-Date: Fri, 08 Jul 2022 09:18:08 +0000 Gerrit-HasComments: Yes
