GitHub user ahmedahamid opened a pull request:

    https://github.com/apache/samza/pull/498

    SAMZA-1476: Fix TestStatefulTask flaky test

    Unable to reproduce the issue even after constraining CPU/memory resources 
available to the JVM, this fix addresses a potential root cause — a 
`CountDownLatch` shared between 2 threads, main test thread and Kafka producer 
thread, but not marked volatile even though it is reinitialized by the main 
test thread. This could cause the reported issue since each of the 2 threads 
could end up invoking `countDown`/`await` on a different `CountDownLatch` 
object.
    
    It is worthwhile to mention that without this fix, a different test, 
`TestShutdownStatefulTask`, should have also exhibited some flakiness since it 
shares the same `TestTask` base with `TestStatefulTask` and exercises exactly 
the same portion of code that includes the failing assertion. Since no such 
flakiness was reported for `TestShutdownStatefulTask` however, the assumption 
made by this fix is that it might have not been encountered or reported.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ahmedahamid/samza dev/fix-1476

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/samza/pull/498.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #498
    
----
commit 973d224e439f736da27a495f8470f4086b08b5cb
Author: Ahmed Abdul Hamid <ahabdulh@...>
Date:   2018-05-01T18:40:22Z

    SAMZA-1476: Fix TestStatefulTask flaky test
    
    Unable to reproduce the issue even after constraining CPU/memory resources 
available to the JVM, this fix addresses a potential root cause — a 
CountDownLatch shared between 2 threads, main test thread and Kafka producer 
thread, but not marked volatile even though it is reinitialized by the main 
test thread. This could cause the reported issue since each of the 2 threads 
could end up invoking countDown/await on a different reference.

----


---

Reply via email to