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

Not working link credits #20

Open
vyzigold opened this issue Aug 5, 2021 · 1 comment
Open

Not working link credits #20

vyzigold opened this issue Aug 5, 2021 · 1 comment

Comments

@vyzigold
Copy link
Contributor

vyzigold commented Aug 5, 2021

I think the following line should be int credit = free - link_credit - 1; instead for credits to work correctly.

int credit = free - link_credit + 1;

This line should determine by how much to increase the current link credit (I think the link credit should be equal to how much space we have inside the ring buffer in the end). After looking at the rb_put and rb_free_size code, the free variable in the line above seems to be 1 when we get an amqp_overrun. We don't want to increase the link credit when getting overruns, so we need the -1.

I tested flooding bridge with messages with int credit = free - link_credit and I got amqp_overruns. With the proposed int credit = free - link_credit - 1 I didn't get any overrun.

This creates another problem when the link credit reaches 0 (the rb is full, we don't want the sender to send anything). Because of that we can't receive any message and this code doesn't get executed again, so we can't increase the link credit. I could probably solve this if we decide this is a thing we want to do.

@leifmadsen
Copy link
Member

@vyzigold Do we still think this could be a problem, and something that should actually be fixed going forward? I'm just wondering as we ramp down on STF if this is a potential issue that we might see in live environments that would be nice to resolve before we have any bugs filed for it.

Recently I saw a post with this error, and I'm unsure if it could be related at all:

ROUTER_CORE (info) [C34][L245] Stuck delivery: At least one delivery on this link has been undelivered/unsettled for more than 10 seconds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants