[
https://issues.apache.org/jira/browse/ARTEMIS-6031?focusedWorklogId=1017859&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1017859
]
ASF GitHub Bot logged work on ARTEMIS-6031:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 29/Apr/26 07:02
Start Date: 29/Apr/26 07:02
Worklog Time Spent: 10m
Work Description: AntonRoskvist commented on code in PR #6387:
URL: https://github.com/apache/artemis/pull/6387#discussion_r3159145255
##########
artemis-core-client/src/test/java/org/apache/activemq/artemis/core/client/impl/AsynchronousProducerCreditsImplTest.java:
##########
@@ -32,4 +38,51 @@ public void testZeroCredits() throws Exception {
Mockito.verify(session).sendProducerCreditsMessage(0, null);
}
+ @Test
+ @Timeout(10)
+ public void testCreditsRequestedWhenMessageSizeExactlyEqualsBalance()
throws Exception {
+ ClientSessionInternal mockClientSession =
Mockito.mock(ClientSessionInternal.class);
+
+ AtomicInteger creditsRequested = new AtomicInteger(0);
+ AtomicBoolean blocked = new AtomicBoolean(false);
+
+ int producerWindowSize = 1000;
+
+ Mockito.doAnswer(inv -> {
+ creditsRequested.addAndGet(inv.getArgument(0));
+ return null;
+ }).when(mockClientSession).sendProducerCreditsMessage(Mockito.anyInt(),
Mockito.any());
+
+ AsynchronousProducerCreditsImpl producerCredits = new
AsynchronousProducerCreditsImpl(mockClientSession, null, producerWindowSize,
bridgeFlowCallback(blocked));
Review Comment:
I agree, thanks
Issue Time Tracking
-------------------
Worklog Id: (was: 1017859)
Time Spent: 40m (was: 0.5h)
> Handle credit starvation affecting Core bridge
> ----------------------------------------------
>
> Key: ARTEMIS-6031
> URL: https://issues.apache.org/jira/browse/ARTEMIS-6031
> Project: Artemis
> Issue Type: Bug
> Reporter: Anton Roskvist
> Priority: Major
> Labels: pull-request-available
> Time Spent: 40m
> Remaining Estimate: 0h
>
> This relates to ARTEMIS-5733
> The fix in that case is still valid but turns out there was a similar thing
> that could happen in "AbstractProducerCreditsImpl" as well.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]