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

D2C messages sent over 1MB in size via AMQP are currently being retried by the SDK #2055

Closed
abhipsaMisra opened this issue Jun 29, 2021 · 3 comments
Assignees
Labels
bug Something isn't working. fix-checked-in Fix checked into main or preview, but not yet released. IoTSDK Tracks all IoT SDK issues across the board

Comments

@abhipsaMisra
Copy link
Member

When a D2C message over 1MB in size is sent to IoT Hub over AMQP, instead of throwing a MessageTooLargeException immediately, the operation is instead retried and an OperationCancelledException is eventually thrown.

@abhipsaMisra abhipsaMisra added the bug Something isn't working. label Jun 29, 2021
@github-actions github-actions bot added the IoTSDK Tracks all IoT SDK issues across the board label Jun 29, 2021
@abhipsaMisra
Copy link
Member Author

This issue happens because the service exhibits different behaviors for different sizes of D2C messages when over the 256KB limit.

  • For messages between 256KB and 1MB in size, service returns an amqp outcome of “rejected” with the specified error code. This outcome is translated by the sdk to a MessageTooLargeException and is returned to the caller.
  • For messages over 1MB, the message is rejected by the amqp layer itself, even before it reaches the service’s application layer. As a result, the amqp layer rejects the message and closes the accompanying links ungracefully. This link closure is detected by the sdk as an OperationCancelledException and it tries to recover. This causes the sdk to retry the failed operation, resulting in the sdk resending the overly large data.

@abhipsaMisra
Copy link
Member Author

Even though service should exhibit the same behavior for all messages exceeding the hub specified limit of 256kb, the sdk will also be updated the inspect the inner exception details in case of ungraceful link closures.

@abhipsaMisra
Copy link
Member Author

This fix has been released in our latest release: https://github.com/Azure/azure-iot-sdk-csharp/releases/tag/2021-8-11
Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. fix-checked-in Fix checked into main or preview, but not yet released. IoTSDK Tracks all IoT SDK issues across the board
Projects
None yet
Development

No branches or pull requests

1 participant