ARTEMIS-5733 Core bridge can lock on flow control#6020
Conversation
|
So to clarify the change... if the Following this, the bridge will return all calls to |
|
Nice find! A single character bug fix. I recommend removing your existing test and adding this to the tests in package org.apache.activemq.artemis.core.client.impl;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
import org.mockito.Mockito;
public class AsynchronousProducerCreditsImplTest {
@Test
@Timeout(10)
public void testZeroCredits() throws Exception {
ClientSessionInternal session = Mockito.mock(ClientSessionInternal.class);
AsynchronousProducerCreditsImpl producerCredits = new AsynchronousProducerCreditsImpl(session, null, 0, Mockito.mock(ClientProducerFlowCallback.class));
producerCredits.receiveCredits(0);
Mockito.verify(session).sendProducerCreditsMessage(0, null);
}
}This test is simpler, faster, and reproduces the problem every time. |
a57c39c to
0e88e9d
Compare
|
Thanks @jbertram , that's a much better test! |
|
I'll merge as soon as the PR builds complete successfully! |
|
The failure of |
I've observed this issue happening in live environments for a long time but it's very uncommon. In the environment where it happens most frequently it's no more than something like once a month or so.
I've been unable to find a really exact way of triggering the issue artificially, but the added test
testBridgeHandlesReachingZeroCreditsdoes it fairly reliably.I'm open to changing the test if anyone has any suggestions on how to precisely trigger the issue... or just remove it and accept the change based on static analysis.