filer write request use context without cancellation (#7567)

* filer use context without cancellation

* pass along context
This commit is contained in:
Chris Lu
2025-11-28 11:52:57 -08:00
committed by GitHub
parent 03ce060e85
commit 7e4bab8032
4 changed files with 13 additions and 7 deletions

View File

@@ -185,7 +185,10 @@ func (fs *FilerServer) doUpload(ctx context.Context, urlLocation string, limited
return nil, err, []byte{}
}
uploadResult, err, data := uploader.Upload(ctx, limitedReader, uploadOption)
// Use a context that ignores cancellation from the request context
uploadCtx := context.WithoutCancel(ctx)
uploadResult, err, data := uploader.Upload(uploadCtx, limitedReader, uploadOption)
if uploadResult != nil && uploadResult.RetryCount > 0 {
stats.FilerHandlerCounter.WithLabelValues(stats.ChunkUploadRetry).Add(float64(uploadResult.RetryCount))
}
@@ -244,7 +247,6 @@ func (fs *FilerServer) dataToChunkWithSSE(ctx context.Context, r *http.Request,
var sseType filer_pb.SSEType = filer_pb.SSEType_NONE
var sseMetadata []byte
// Create chunk with SSE metadata if available
var chunk *filer_pb.FileChunk
if sseType != filer_pb.SSEType_NONE {