Extend write deadline for app install/uninstall RPCs - #304
Open
mobile-kevin wants to merge 1 commit into
Open
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThe server adds an 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
device.apps.install and device.apps.uninstall run under the default 10s WriteTimeout because they were missing from the per-method deadline extension in handleJSONRPC. On devices where an install takes longer than 10s, the server hits the write deadline and closes the connection mid-response; the caller (mobilefleet-client) sees an opaque `Post "http://localhost:12000/rpc": EOF` and reports the install as failed even though the app is valid. Extend the deadline to 3 minutes for install/uninstall (matching device.boot) and refactor the per-method deadlines into a testable extendedWriteDeadline() helper with unit tests, so a slow method can't be silently omitted from the list again. Claude-Session: https://claude.ai/code/session_01NTmaydwxEmvPEYdiK3Q4yS
mobile-kevin
force-pushed
the
fix/install-uninstall-write-deadline
branch
from
July 17, 2026 19:40
fc435a0 to
3a1f211
Compare
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.
Summary
device.apps.install(anddevice.apps.uninstall) run under the HTTP server's default 10sWriteTimeoutbecause they were never added to the per-method write-deadline extension inhandleJSONRPC. On devices where an install legitimately takes longer than 10s, the server hits the write deadline and closes the connection mid-response. The caller —mobilefleet-client— sees an opaque:…and reports the install as failed, even when the app is valid (it installs fine from the web portal). Because the error is a bare transport EOF, it reads like a bad app rather than a timeout, which is exactly how it was mis-triaged.
Evidence
From production logs, install outcomes over 2 days:
A clean split at the 10s boundary: every success finished ≤10s, every EOF failure took ≥11s — the signature of the
WriteTimeoutfiring. The mobilecli process stays alive throughout (its heartbeat RPCs keep succeeding), so it isn't a crash; only the long install request is severed.mobilefleet-client's own RPC client timeout is 5 minutes, so it is not the limiter.Fix
device.bootalready extends the write deadline to 3 minutes for exactly this reason; install/uninstall are just as slow and were simply missing from the list. This adds them, and refactors the per-method deadlines into a small, testableextendedWriteDeadline()helper so a slow method can't be silently omitted again.Testing
go test ./server/— full package green, including two new tests (TestExtendedWriteDeadlineForSlowMethods,TestNoExtendedWriteDeadlineForFastMethods).go vet ./server/,gofmtclean.Notes / scope
mobilefleet-clientchange (classify the transport EOF distinctly from a real install rejection so it isn't reported as a generic "Install failed") is worth doing separately.https://claude.ai/code/session_01NTmaydwxEmvPEYdiK3Q4yS