Michael Blow has posted comments on this change. Change subject: [NO ISSUE][TX] Fix DatasetLock for Multiple Index Builds ......................................................................
Patch Set 4: (2 comments) https://asterix-gerrit.ics.uci.edu/#/c/2144/4/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/lock/DatasetLock.java File asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/lock/DatasetLock.java: PS4, Line 93: boolean interrupted = false; : while (indexBuildCounter.getValue() > 0) { : try { : indexBuildCounter.wait(); : } catch (InterruptedException e) { : interrupted = true; : } : } : synchronized (dsModifyCounter) { : dsModifyCounter.increment(); : } : if (interrupted) { : Thread.currentThread().interrupt(); : } I think you can use InterruptUtil.doUninterruptibly() to simplify PS4, Line 141: while (!locked) { : synchronized (dsModifyCounter) { : if (dsModifyCounter.getValue() == 0) { : indexBuildCounter.setValue(indexBuildCounter.getValue() + 1); : locked = true; : } : } : if (!locked) { : try { : indexBuildCounter.wait(); : } catch (InterruptedException e) { : interrupted = true; : } : } : } : if (interrupted) { : Thread.currentThread().interrupt(); : } I think you can use InterruptUtil.doUninterruptibly() to simplify -- To view, visit https://asterix-gerrit.ics.uci.edu/2144 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3bea3ff2075d952ab13402b0c445c464b431c0f5 Gerrit-PatchSet: 4 Gerrit-Project: asterixdb Gerrit-Branch: release-0.9.3-pre-rc Gerrit-Owner: abdullah alamoudi <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Michael Blow <[email protected]> Gerrit-HasComments: Yes
