zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From afine <...@git.apache.org>
Subject [GitHub] zookeeper pull request #327: ZOOKEEPER-2786 Flaky test: org.apache.zookeeper...
Date Thu, 03 Aug 2017 20:11:19 GMT
GitHub user afine opened a pull request:

    https://github.com/apache/zookeeper/pull/327

    ZOOKEEPER-2786 Flaky test: org.apache.zookeeper.test.ClientTest.testNonExistingOpCode

    This is the third time this failure has popped up. This time it seemed to only impact
tests run using NettyServerCnxnFactory (so it only impacts 3.5 and master) and I was able
to get it to pop up with sufficient frequency when running the tests locally. 
    
    The issue is caused by improper handling of netty's futures. When we call `channel.write(wrappedBuffer(sendBuffer));`
the write is completed asynchronously. The close call `channel.close();` is also asynchronous.
So we can run into the case where the close occurs before a write.
    
    This patch changes our close call to be a callback for the completion of an empty write.
This way we are guaranteed that the channel has "drained" before a close. 
    
    My primary concern with this patch is the channel being used while it is closing (between
the write of an empty buffer and the execution of the close callback). I have added a `closingChannel`
boolean to track that, which I believe is sufficient. Let me know if anyone finds a situation
where that is not the case.

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

    $ git pull https://github.com/afine/zookeeper ZOOKEEPER-2786_third_times_a_charm

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

    https://github.com/apache/zookeeper/pull/327.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 #327
    
----
commit 6e16b20cd2f768e9a027f1d9306ae8126188edb4
Author: Abraham Fine <afine@apache.org>
Date:   2017-08-03T20:02:06Z

    ZOOKEEPER-2786: Flaky test: org.apache.zookeeper.test.ClientTest.testNonExistingOpCode

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message