Ádám Bakai has posted comments on this change. ( http://gerrit.cloudera.org:8080/22056 )
Change subject: [subprocess] KUDU-3624 Fix DoWait thread-safety ...................................................................... Patch Set 1: (6 comments) http://gerrit.cloudera.org:8080/#/c/22056/1//COMMIT_MSG Commit Message: http://gerrit.cloudera.org:8080/#/c/22056/1//COMMIT_MSG@12 PS1, Line 12: EchoSubprocessTest.TestSubprocessMetricsOnError > Add detail about how this fix was tested. Even better it is possible to add It was fixed this way: "To fix this behaviour, wait_mutex_ is added. If a thread runs and evaluates waitpid, other threads won't execute it in the same time. If locking is unsucesful but the WaitMode is NON_BLOCKING, then return as if nothing happened." Added new unit test: SubprocessTest.TestMultiThreadWait. http://gerrit.cloudera.org:8080/#/c/22056/1//COMMIT_MSG@15 PS1, Line 15: a check > Add a one liner on what check fails. Done http://gerrit.cloudera.org:8080/#/c/22056/1//COMMIT_MSG@19 PS1, Line 19: unsucesful > nit: unsuccessful Done http://gerrit.cloudera.org:8080/#/c/22056/1/src/kudu/util/subprocess.h File src/kudu/util/subprocess.h: http://gerrit.cloudera.org:8080/#/c/22056/1/src/kudu/util/subprocess.h@225 PS1, Line 225: Mutex wait_mutex_; > Why not to use std::mutex instead? Done http://gerrit.cloudera.org:8080/#/c/22056/1/src/kudu/util/subprocess.h@231 PS1, Line 231: > nit: Remove this Done http://gerrit.cloudera.org:8080/#/c/22056/1/src/kudu/util/subprocess.cc File src/kudu/util/subprocess.cc: http://gerrit.cloudera.org:8080/#/c/22056/1/src/kudu/util/subprocess.cc@815 PS1, Line 815: std::unique_lock lock(wait_mutex_, std::try_to_lock); > Why not move this to start of the function? It is not used there. It's better to put near to the first point where it is used. -- To view, visit http://gerrit.cloudera.org:8080/22056 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1cb540860b439c26e1c8529123c8b29940d9f84f Gerrit-Change-Number: 22056 Gerrit-PatchSet: 1 Gerrit-Owner: Ádám Bakai <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Ashwani Raina <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Ádám Bakai <[email protected]> Gerrit-Comment-Date: Mon, 18 Nov 2024 16:08:21 +0000 Gerrit-HasComments: Yes
