[ 
https://issues.apache.org/jira/browse/CASSANDRA-13397?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Podkowinski updated CASSANDRA-13397:
-------------------------------------------
    Fix Version/s:     (was: 3.0.x)
                   3.0.14
                   3.11.0
                   4.0

> Return value of CountDownLatch.await() not being checked in Repair
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-13397
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13397
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Simon Zhou
>            Assignee: Simon Zhou
>            Priority: Minor
>             Fix For: 3.0.14, 3.11.0, 4.0
>
>         Attachments: CASSANDRA-13397-v1.patch
>
>
> 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:
> {code}
>     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");
>         }
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to