fix(nzbfs): bind file context to HTTP request context and reduce server WriteTimeout - #816
Open
DarkseidAM wants to merge 2 commits into
Open
fix(nzbfs): bind file context to HTTP request context and reduce server WriteTimeout#816DarkseidAM wants to merge 2 commits into
DarkseidAM wants to merge 2 commits into
Conversation
Owner
|
I think this can be achieve by seting up a context with cancel timeout on open the file, you don't need any watchdog |
DarkseidAM
force-pushed
the
fix/webdav-idle-watchdog-timeout
branch
from
August 10, 2026 16:22
ded1bd6 to
b02ecc9
Compare
Contributor
Author
|
Refactored as suggested in the force-push: removed the per-file The PR now relies on:
|
…er WriteTimeout - Wrap OpenFile context in request-derived child context so HTTP client disconnects automatically cancel in-flight UsenetReader downloads - Reduce http.Server WriteTimeout from 30 minutes to 3 minutes in setup.go to prevent orphaned HTTP connections
DarkseidAM
force-pushed
the
fix/webdav-idle-watchdog-timeout
branch
from
August 10, 2026 16:25
b02ecc9 to
805d063
Compare
Owner
|
Now you add this cancelCtx but you don't use it anywhere |
Contributor
Author
|
Apologies, forgot to stage the commit |
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.
Description
This PR addresses an issue where WebDAV reads can hang indefinitely when Usenet segment downloads stall or network connections drop silently.
Root Cause
http.Server.WriteTimeoutwas hardcoded to30 * time.Minuteinsetup.go. If a client (rclone) timed out and dropped the connection, Altmount kept the response goroutine open for up to 30 minutes.OpenFilepassed a context that did not automatically cancel when an HTTP request disconnected.Changes
OpenFilecontext in a child context derived from the HTTP request context (fileCtx, cancel := context.WithCancel(ctx)), ensuring client disconnects automatically cancel in-flightUsenetReaderdownloads.WriteTimeoutinsetup.gofrom 30 minutes to 3 minutes to automatically close idle/stalled HTTP streams.