fix(doctor): time out the S3 probe and stream check results - #3654
Merged
Conversation
Preview DeploymentPreview deployments for this PR are available at:
The preview environment will start automatically on first visit. Subsequent pushes to this PR will update the Run locally with Dockerdocker pull ghcr.io/go-vikunja/vikunja:pr-3654
docker run -p 3456:3456 ghcr.io/go-vikunja/vikunja:pr-3654Last updated for commit 78d5e3b |
tink-bot
force-pushed
the
fix-doctor-s3-timeout
branch
from
August 29, 2026 16:01
500d42b to
9cd46c7
Compare
tink-bot
force-pushed
the
fix-doctor-s3-timeout
branch
from
August 29, 2026 16:09
9cd46c7 to
49006dc
Compare
The S3 backend passed context.Background() to every AWS call, so an unreachable but well-formed endpoint blocked until the OS TCP timeout with no way to interrupt it. Write, Stat and Remove now take the caller's context.
vikunja doctor hung indefinitely against a blackholed S3 endpoint. 12s is well above a healthy round trip including TLS and SDK retries, well under the OS TCP timeout, and the same order as the existing 5s Redis deadline.
Every group was collected before anything was printed, so one slow check withheld the entire report including groups that had already passed. Order, formatting, summary and exit codes are unchanged.
tink-bot
force-pushed
the
fix-doctor-s3-timeout
branch
from
August 29, 2026 17:12
49006dc to
78d5e3b
Compare
kolaente
approved these changes
Aug 29, 2026
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.
vikunja doctorhung forever with zero output whenfiles.type: s3pointed at an unreachable but well-formed endpoint. Againsthttp://10.255.255.1:9999it produced nothing at all and had to be killed after 60 seconds.Two compounding causes, both fixed:
context.Background()to every AWS call, so the probe blocked until the OS TCP timeout with no way to interrupt it.Write,StatandRemovenow take the caller's context, and doctor bounds the S3 checks with 12s. That is well above a healthy round trip including TLS and SDK retries, well under the OS TCP timeout, and the same order as the existing 5s Redis deadline.doctor.Run()collected all groups beforePrintResultsran, so one stalled check withheld the whole report including the groups that had already passed. Groups now print as they complete. Order, formatting, the summary line and exit codes are unchanged.Worth noting the hang was not in
checkS3Storage— it was in the storage init that runs before it, which is why no output appeared at all rather than a partial report.Measured: 60s+ (killed, no output) → 12.2s with the earlier groups printed immediately.
Local storage is untouched: it keeps
context.Background(), and its full doctor output diffs clean against a binary built from the merge base. Missing credentials and malformed endpoints still fail instantly rather than waiting out the deadline.How to verify
files: {type: s3, s3: {endpoint: "http://10.255.255.1:9999", bucket: b, region: us-east-1, accesskey: k, secretkey: s}}.time vikunja doctoragainst it.✗ Writable: S3 endpoint http://10.255.255.1:9999 did not respond within 12s.Then confirm the fast failures did not become slow:
accesskey. Expected: it fails immediately withS3 access key is not configured. Please set files.s3.accesskey, not after 12 seconds.ht!tp://%%%bad. Expected: it fails immediately withwas not a valid URI.Then confirm local storage is unaffected: