Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ringbuffer.readManyAsync inconsistent exception handling client vs. member #12108

Closed
tombujok opened this issue Jan 8, 2018 · 1 comment
Closed

Comments

@tombujok
Copy link
Contributor

@tombujok tombujok commented Jan 8, 2018

Client unwraps the ExecutionException before throwing it to the user code.
The member never does it. It also does not happen on other async proxies. Client should not unwrap.

RingbufferQuorumReadTest & ClientRingbufferQuorumReadTest are a good example how to reproduce it.

After fixing, clean-up this test by removing the catch clause and adding
expectedException.expectCause(isA(QuorumException.class));

https://github.com/tombujok/hazelcast/blob/9bb5df6812c50ac769bd93fdf72a5a3a5b7db34b/hazelcast/src/test/java/com/hazelcast/quorum/ringbuffer/RingbufferQuorumReadTest.java#L148-L152

@tombujok tombujok added this to the 3.10 milestone Jan 8, 2018
@tombujok tombujok changed the title Ringbuffer.readManyAsync inconsiscent execption handling client vs. member Ringbuffer.readManyAsync inconsistent exception handling client vs. member Jan 8, 2018
@taburet taburet added Team: Core and removed Team: Core labels Jan 22, 2018
@mdogan mdogan added Team: Client and removed Team: Core labels Feb 12, 2018
@mmedenjak mmedenjak modified the milestones: 3.10, 3.11 Feb 21, 2018
@sancar
Copy link
Member

@sancar sancar commented May 10, 2018

Pasting the mentioned test here since link is out of date

  @Test
    public void readManyAsync_noQuorum() {
        try {
            ring(3).readManyAsync(1L, 1, 1, new Filter()).get();
        } catch (Exception ex) {
            if (ex instanceof QuorumException || ex.getCause() instanceof QuorumException) {
                return;
            }
        }
        fail("Expected QuorumException top-level or as cause");
    }

Made a little bit investigation here. Problem is not with wrapping.

Clients does a remote call inside readManyAsync (to get capacity) while members do not. That results with client behaving differently.

ICompletableFuture future = ring(3).readManyAsync(1L, 1, 1, new Filter());
future.get();

In a test above when quorum is not present. Client fails with QuorumException in the first line.
Member fails with ExecutionException(cause QuorumException) in the second line.

@sancar sancar self-assigned this May 10, 2018
sancar added a commit to sancar/hazelcast that referenced this issue May 10, 2018
readManyAsync throws different exception when there is no quorum.

Client fails with QuorumException.
Member fails with ExecutionException(cause QuorumException).

This pr makes client behave similarly to member.

fixes hazelcast#12108
sancar added a commit to sancar/hazelcast that referenced this issue May 10, 2018
readManyAsync throws different exception when there is no quorum.

Client fails with QuorumException.
Member fails with ExecutionException(cause QuorumException).

This pr makes client behave similarly to member.

fixes hazelcast#12108
sancar added a commit to sancar/hazelcast that referenced this issue May 10, 2018
readManyAsync throws different exception when there is no quorum.

Client fails with QuorumException.
Member fails with ExecutionException(cause QuorumException).

This pr makes client behave similarly to member.

fixes hazelcast#12108
sancar added a commit to sancar/hazelcast that referenced this issue May 11, 2018
readManyAsync throws different exception when there is no quorum.

Client fails with QuorumException.
Member fails with ExecutionException(cause QuorumException).

This pr makes client behave similarly to member.

fixes hazelcast#12108

(cherry picked from commit 3f5c81f)
blazember added a commit to blazember/hazelcast that referenced this issue May 29, 2018
readManyAsync throws different exception when there is no quorum.

Client fails with QuorumException.
Member fails with ExecutionException(cause QuorumException).

This pr makes client behave similarly to member.

fixes hazelcast#12108

(cherry picked from commit 3f5c81f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

5 participants
You can’t perform that action at this time.