Skip to content

fix(shadows): bound Get/Update response waits so a lost reply can't park a shadow - #141

Merged
MathiasKoch merged 2 commits into
masterfrom
fix/bound-shadow-request-waits
Aug 20, 2026
Merged

MathiasKoch merged 2 commits into
masterfrom
fix/bound-shadow-request-waits

Conversation

@KennethKnudsen97

Copy link
Copy Markdown
Member

AWS publishes shadow Accepted/Rejected once and never re-sends. If the link drops between our publish and the reply, the wait had no bound — and a session resumed with session_present=1 keeps the subscription alive, so no clean-session None wakes it either. The caller parks forever.

That's worst in get_shadow_from_cloud: handle_delta recovers 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, matching DELTA_ACK_TIMEOUT) and returns 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.

The live delta subscription in handle_delta stays 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.

Kenneth Sylvest Knudsen and others added 2 commits August 20, 2026 10:59
…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.
@MathiasKoch
MathiasKoch merged commit 9fac91b into master Aug 20, 2026
9 of 10 checks passed
@MathiasKoch
MathiasKoch deleted the fix/bound-shadow-request-waits branch August 20, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants