Skip to content

MockZooKeeper#failNow is unreliable#7109

Merged
merlimat merged 2 commits intoapache:masterfrom
merlimat:pr-b0d905205f
Jun 1, 2020
Merged

MockZooKeeper#failNow is unreliable#7109
merlimat merged 2 commits intoapache:masterfrom
merlimat:pr-b0d905205f

Conversation

@merlimat
Copy link
Contributor

Motivation

The MockZooKeeper#failNow instructs the MockZooKeeper instance to fail
the next call to zookeeper. In a multithreaded system with many things
accessing zookeeper, using #failNow is unreliable, as a background
thread could try to access ZK before the call that is actually under
tests accesses it.

This change tightens the condition on which the failed ZK call can
occur, by checking the operation type and path. This resolves a flake
that was occurring in ZooKeeperSessionExpiryRecoveryTest.

The MockZooKeeper#failNow instructs the MockZooKeeper instance to fail
the next call to zookeeper. In a multithreaded system with many things
accessing zookeeper, using #failNow is unreliable, as a background
thread could try to access ZK before the call that is actually under
tests accesses it.

This change tightens the condition on which the failed ZK call can
occur, by checking the operation type and path. This resolves a flake
that was occuring in ZooKeeperSessionExpiryRecoveryTest.
@merlimat merlimat added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages area/test type/flaky-tests labels May 30, 2020
@merlimat merlimat added this to the 2.6.0 milestone May 30, 2020
@merlimat merlimat merged commit 7314ac2 into apache:master Jun 1, 2020
@merlimat merlimat deleted the pr-b0d905205f branch June 1, 2020 16:19
Huanli-Meng pushed a commit to Huanli-Meng/pulsar that referenced this pull request Jun 12, 2020
* MockZooKeeper#failNow is unreliable

The MockZooKeeper#failNow instructs the MockZooKeeper instance to fail
the next call to zookeeper. In a multithreaded system with many things
accessing zookeeper, using #failNow is unreliable, as a background
thread could try to access ZK before the call that is actually under
tests accesses it.

This change tightens the condition on which the failed ZK call can
occur, by checking the operation type and path. This resolves a flake
that was occuring in ZooKeeperSessionExpiryRecoveryTest.

* Fixed import missing after merge

Co-authored-by: Ivan Kelly <ikelly@splunk.com>
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Aug 24, 2020
* MockZooKeeper#failNow is unreliable

The MockZooKeeper#failNow instructs the MockZooKeeper instance to fail
the next call to zookeeper. In a multithreaded system with many things
accessing zookeeper, using #failNow is unreliable, as a background
thread could try to access ZK before the call that is actually under
tests accesses it.

This change tightens the condition on which the failed ZK call can
occur, by checking the operation type and path. This resolves a flake
that was occuring in ZooKeeperSessionExpiryRecoveryTest.

* Fixed import missing after merge

Co-authored-by: Ivan Kelly <ikelly@splunk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/test type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages type/flaky-tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants