fix(shadows): bound Get/Update response waits so a lost reply can't park a shadow - #141
Merged
Merged
Conversation
…ark a shadow AWS publishes Accepted/Rejected once and never re-sends. If the link drops between our publish and the reply, the wait had no bound, and a resumed session (session_present=1) keeps the subscription alive so no clean-session None wakes it either. handle_delta recovers missed deltas via a GET on resubscribe, so a parked GET silently kills every later delta for that shadow. Bound both round-trips (REQUEST_TIMEOUT=30s) and return Error::Timeout; callers already loop and retry. apply_delta_and_ack maps the new Timeout onto its existing deferred-ack path so an applied delta is still kept.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
AWS publishes shadow
Accepted/Rejectedonce and never re-sends. If the link drops between our publish and the reply, the wait had no bound — and a session resumed withsession_present=1keeps the subscription alive, so no clean-sessionNonewakes it either. The caller parks forever.That's worst in
get_shadow_from_cloud:handle_deltarecovers deltas missed while offline by doing a GET on resubscribe, so a parked GET silently kills every later delta for that shadow until reboot.Bounds all three round-trips (
REQUEST_TIMEOUT= 30s, matchingDELTA_ACK_TIMEOUT) and returnsError::Timeout. Callers already loop and retry.apply_delta_and_ackmaps the newTimeoutonto its existing deferred-ack path so an applied delta is still kept.The live delta subscription in
handle_deltastays unbounded — that one should block indefinitely.Seen in the field as a wifi shadow that received zero inbound messages for a whole boot while the sensors shadow resynced three times.