Tim Armstrong has posted comments on this change. ( http://gerrit.cloudera.org:8080/15673 )
Change subject: IMPALA-9612: Fix race condition in RuntimeFilter::WaitForArrival ...................................................................... Patch Set 3: (5 comments) Thanks for adding the test! We have also done things with "debug actions" that can be enabled with end-to-end tests. E.g. see PUBLISH_FILTER_DELAY. But I think a unit test is better than an end-to-end test for this. I have a bunch of style comments but the tests and logic LGTM http://gerrit.cloudera.org:8080/#/c/15673/3/be/src/runtime/runtime-filter-test.cc File be/src/runtime/runtime-filter-test.cc: http://gerrit.cloudera.org:8080/#/c/15673/3/be/src/runtime/runtime-filter-test.cc@51 PS3, Line 51: callWaitFor nit: CallWaitFor() according to the style guide: https://google.github.io/styleguide/cppguide.html#Function_Names You can also remove the need for the void parameters if you use a C++ thread + lambda. http://gerrit.cloudera.org:8080/#/c/15673/3/be/src/runtime/runtime-filter-test.cc@52 PS3, Line 52: auto tc = (TestConfig*)vargp; nit: we use c++-style casts. reinterpret_cast<TestConfig>(...) in this case. http://gerrit.cloudera.org:8080/#/c/15673/3/be/src/runtime/runtime-filter-test.cc@54 PS3, Line 54: NULL nit: nullptr http://gerrit.cloudera.org:8080/#/c/15673/3/be/src/runtime/runtime-filter-test.cc@82 PS3, Line 82: pthread_create(&t1, NULL, callWaitFor, (void*)&tc); We use C++-style threads in the codebase which wrap pthreads and provide some niceties. E.g. see BufferTransferConcurrent in buffer-pool-test.cc for an example. You can use C++ lambdas in conjunction with those, which I think means you can reduce this to something like: threads.add_thread(new thread([&tc] { tc.runtime_filter->WaitForArrival(tc.wait_for_ms); }); http://gerrit.cloudera.org:8080/#/c/15673/3/be/src/runtime/runtime-filter-test.cc@109 PS3, Line 109: ahead nit: a head -- To view, visit http://gerrit.cloudera.org:8080/15673 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7dffa626103ef0af06ad1e89231b0d2ee54bb94a Gerrit-Change-Number: 15673 Gerrit-PatchSet: 3 Gerrit-Owner: Riza Suminto <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Riza Suminto <[email protected]> Gerrit-Reviewer: Tim Armstrong <[email protected]> Gerrit-Comment-Date: Wed, 08 Apr 2020 18:07:14 +0000 Gerrit-HasComments: Yes
