Browse Source

Update weed/server/filer_server_handlers_read.go

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
pull/7423/head
Chris Lu 1 month ago
committed by GitHub
parent
commit
94f47b577d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 5
      weed/server/filer_server_handlers_read.go

5
weed/server/filer_server_handlers_read.go

@ -288,9 +288,10 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)
}
}
// Use background context for streaming so client disconnects/cancellations don't abort volume server operations.
// Use a detached context for streaming so client disconnects/cancellations don't abort volume server operations,
// while preserving request-scoped values like tracing IDs.
// Matches S3 API behavior. Request context (ctx) is used for metadata operations above.
streamCtx, streamCancel := context.WithCancel(context.Background())
streamCtx, streamCancel := context.WithCancel(context.WithoutCancel(ctx))
streamFn, err := filer.PrepareStreamContentWithThrottler(streamCtx, fs.filer.MasterClient, fs.maybeGetVolumeReadJwtAuthorizationToken, chunks, offset, size, fs.option.DownloadMaxBytesPs)
if err != nil {

Loading…
Cancel
Save