Skip to content

Conversation

@l0lawrence
Copy link
Member

@l0lawrence l0lawrence commented Oct 26, 2023

Every time we receive a TransferFrame from the service in pyAMQP, we immediately subtract 1 from our current_link_credit, causing us to send FlowFrame's when the current_link_credit runs out.

In the case of large messages that are split over multiple TransferFrame's this causes our current_link_credit to deplete quickly because each frame subtracts 1. If the message is large enough, the current_link_credit then can get into the negative numbers and cause us to send multiple FlowFrame's for no reason. Then when the link credit actually depletes, our line in the AMQPReceiveClient never gets hit because we check equivalency to 0 (at this point, current_link_credit is negative).

What should happen:

Every time we receive a large message via multiple TransferFrame's we should only subtract 1 from our current_link_credit for the entire message. This will prevent our current_link_credit from dipping into the negatives without us knowing.

Creates #32861

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@l0lawrence
Copy link
Member Author

/azp run python - servicebus - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).
Copy link
Member

@swathipil swathipil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be good to add a test

@l0lawrence
Copy link
Member Author

/azp run python - servicebus - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).
@kashifkhan
Copy link
Member

same changes will be needed on the sync side and done for SB as well :)

@l0lawrence
Copy link
Member Author

same changes will be needed on the sync side and done for SB as well :)

they are added on the sync side -- SB will make another pr :)

@l0lawrence l0lawrence marked this pull request as ready for review October 30, 2023 15:49
@l0lawrence l0lawrence requested a review from annatisch as a code owner October 30, 2023 15:49
@l0lawrence
Copy link
Member Author

l0lawrence commented Oct 30, 2023

/azp run python - eventhub - tests

@azure-pipelines
Copy link

No pipelines are associated with this pull request.
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).
@l0lawrence l0lawrence merged commit e3bb7f2 into Azure:main Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4 participants