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
ARTEMIS-2057 Fix runaway credit grants #2272
Conversation
if (receiver.getRemoteCredit() <= threshold) { | ||
receiver.flow(credits); | ||
if (receiver.getCredit() <= threshold) { | ||
receiver.flow(credits - receiver.getCredit()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should protect against trying to flow <=0 after the calculation.
* Test that the AMQPSessionCallback grants no credit when not at threshold | ||
*/ | ||
@Test | ||
public void testOfferProducerWithNoAddressDoesNMotTopOffCreditAboveThresholdN() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typos in name testOfferProducerWithNoAddressDoesNMotTopOffCreditAboveThresholdN
AMQPSessionCallback session = new AMQPSessionCallback( | ||
protonSPI, manager, connection, transportConnection, executor, operationContext); | ||
|
||
// Credit is below threshold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Above threshold?
assertNotNull(argument.getValue()); | ||
argument.getValue().run(); | ||
|
||
// Credit runnable should top off credit to configured value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not top off credit?
* Test that the AMQPSessionCallback grants no credit when not at threshold | ||
*/ | ||
@Test | ||
public void testOfferProducerWithAddressDoesNMotTopOffCreditAboveThresholdN() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typos as earlier
480e41c
to
5730deb
Compare
@gemmellr I've pushed some updates based on comments, thanks for reviewing |
5730deb
to
1e8abbe
Compare
Ensure the broker looks at local receiver credit when checking for credit top off threshold and then do a proper top off back to the high water mark to sync with how client receivers manage their credit.
1e8abbe
to
3425409
Compare
Ensure the broker looks at local receiver credit when checking for
credit top off threshold and then do a proper top off back to the high
water mark to sync with how client receivers manage their credit.