fix(http): time out stalled transactions without killing switched protocols - #2008
Open
nickanderson wants to merge 1 commit into
Open
fix(http): time out stalled transactions without killing switched protocols#2008nickanderson wants to merge 1 commit into
nickanderson wants to merge 1 commit into
Conversation
|
@nickanderson, start a full client pipeline with:
my commands and optionsYou can prevent me from automatically starting CI pipelines:
You can trigger a client pipeline on multiple prs with:
You can trigger a client pipeline for a specific Mender Client release with:
You can trigger GitHub->GitLab branch sync with:
You can print PR statistics for a repository with:
You can deploy a review app with:
You can run e2e tests against a deployed review app with:
You can cherry pick to a given branch or branches with:
|
nickanderson
force-pushed
the
ME-731/master
branch
from
August 4, 2026 18:15
8948e69 to
bc40123
Compare
nickanderson
requested review from
danielskinstad
and removed request for
danielskinstad
August 4, 2026 19:02
nickanderson
marked this pull request as draft
August 4, 2026 19:03
nickanderson
force-pushed
the
ME-731/master
branch
from
August 4, 2026 19:13
bc40123 to
367ee2d
Compare
nickanderson
marked this pull request as ready for review
August 5, 2026 13:12
nickanderson
force-pushed
the
ME-731/master
branch
from
August 5, 2026 13:19
367ee2d to
1342e99
Compare
…tocols A server that accepts a request and never answers left the response read outstanding forever, wedging the client until restart. Arm Beast's stream timeout per operation and disarm it at the 101 Switching Protocols handover -- leaving it armed there closed mender-connect's WebSocket after five minutes and got the previous attempt reverted (MEN-9433). Ticket: ME-731 Changelog: Fixed the client hanging indefinitely when a server accepts a request but never sends a response, which left the device unmanageable until it was restarted. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Nick Anderson <nick@cmdln.org>
nickanderson
force-pushed
the
ME-731/master
branch
from
August 5, 2026 13:34
1342e99 to
c7a9290
Compare
|
Merging these commits will result in the following changelog entries: Changelogsmender (ME-731/master)New changes in mender since master: Bug Fixes |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
A server that accepts a request and then never answers left the response read
outstanding indefinitely, wedging the client silently — alive, no crash, no log
output, recoverable only by restart. Reproduced in a VM on both 5.0.5 and 5.1.0.
The gap was
ReadHeader():AsyncReadNextBodyPartalready had a 5 minute timer,but nothing bounded the wait for response headers.
This arms Beast's stream timeout before each operation of a transaction and
disarms it at the 101 Switching Protocols handover. That handover is what the
previous attempt (
d8ddf6da/4aa01ee8) got wrong: it left the timeout armed,and Beast's
timeout_handlercallsclose()on expiry regardless of who owns thesocket by then, which killed mender-connect's forwarded WebSocket after five
minutes and got the fix reverted under MEN-9433.
Connect is intentionally not covered —
asio::async_connectruns onlowest_layer(), the raw socket, which bypasses the stream timeout entirely.Timeout is
ClientConfig::stream_timeout_seconds, default 300s. No clientendpoint long-polls, and artifact download is a per-chunk body read (unchanged).
Tests
Both are red/green verified — each fails when its own half of the fix is removed:
HttpTest.TestStalledResponseTimesOutHttpForwarderTests.ProtocolSwitchSurvivesIdlePastStreamTimeoutThe forwarder already had five
ProtocolSwitch*tests, but all exercise immediatedata flow; none left the connection idle, which is why MEN-9433 escaped.
Full suites pass:
http_test47/47,http_forwarder_test13/13.End-to-end on 5.0.5 with a stalled
deployments/nextand the reporting customer'sstate scripts: unpatched logs nothing for 420 s, patched logs
Error while polling for deployment: The operation timed outat exactly t+300 s,runs the SyncError/IdleEnter scripts, and resumes polling.
Ticket: ME-731