Fix long-submit timeout errback for multipart SubmitSm transactions #1263
+6
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #
Description
Problem: In multipart SubmitSm (SAR) flows, the long-submit transaction Deferred returned by sendDataRequest() never reaches errback or callback when a timeout occurs, causing the consumer to stall and RabbitMQ unacked messages to accumulate.
Cause: The code called startLongSubmitSmTransaction() to create a Deferred, but the timeout handler erroneously either did not errback the same Deferred or used a bare Exception instead of Failure, so upstream code never resumed.
Fix:
Ensure startLongSubmitSmTransaction() returns the exact same Deferred stored in state.
Timeout handler cancels per-part timers and calls d.errback(Failure(SMPPRequestTimoutError(...))).
Guard callback/errback with if not d.called:.
Not yet Added unit test that simulates no responses for multipart and asserts Deferred fails with SMPPRequestTimoutError.
Impact: This fixes the message-consumer stall issue and ensures multipart flows either succeed or fail in finite time.
Please review and let me know if you’d like additional adjustments (e.g., config setting for timeout behaviour).
Checks
Additional Information