Details
-
Bug
-
Status: Resolved
-
Low
-
Resolution: Fixed
-
None
-
None
-
Low
Description
While looking into repair code, I realize that we should check return value of CountDownLatch.await(). Most of the places that we don't check the return value, nothing bad would happen due to other protection. However, ActiveRepairService#prepareForRepair should have the check. Code to reproduce:
public static void testLatch() throws InterruptedException { CountDownLatch latch = new CountDownLatch(2); latch.countDown(); new Thread(() -> { try { Thread.sleep(1200); } catch (InterruptedException e) { System.err.println("interrupted"); } latch.countDown(); System.out.println("counted down"); }).start(); latch.await(1, TimeUnit.SECONDS); if (latch.getCount() > 0) { System.err.println("failed"); } else { System.out.println("success"); } }
Attachments
Attachments
Issue Links
- links to