hazelcast / hazelcast/hazelcast-cpp-client

[TRACKING ISSUE] Fix ClientReliableTopicOnClusterRestartTest

Open
#770 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
91
Forks
54
Avg merge
1d 12m
Merged PRs (30d)
5

Description

The tracking issue for the Java side PR.

**Fix ClientReliableTopicOnClusterRestartTest**

See https://github.com/hazelcast/hazelcast/pull/16644 for details.

---

Fixes the test testing behaviour of a loss tolerant listener when the
instance is restarted. This test failure is similar to the one described
in https://github.com/hazelcast/hazelcast/issues/16430#issuecomment-571947692 and the [fix PR](https://github.com/hazelcast/hazelcast/pull/16440).

Basically, it might happen that the new item is added to the restarted
member before the listener sends a read operation to the new member.
Since it was previously on a higher sequence, the sequence will be
reset to the currently highest, which is one after the latest added item.

In the case when the item is added to the ringbuffer before the read
operation is executed, the listener will simply ignore the added item
and wait for a new one.

The test asserts that the listener is able to continue after the cluster
restarts so we modify the test so that we add new items until we
eventually get an item.

Also, made some minor modifications like using small instances in the
test and made the sequence field volatile since it is accessed from
different threads.

Fixes: https://github.com/hazelcast/hazelcast/issues/16623

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.