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

@@ -339,7 +339,7 @@ func (fs *FilerServer) saveMetaData(ctx context.Context, r *http.Request, fileNa
}
}
dbErr := fs.filer.CreateEntry(ctx, entry, false, false, nil, skipCheckParentDirEntry(r), so.MaxFileNameLength)
dbErr := fs.filer.CreateEntry(context.WithoutCancel(ctx), entry, false, false, nil, skipCheckParentDirEntry(r), so.MaxFileNameLength)
if dbErr != nil {
replyerr = dbErr
filerResult.Error = dbErr.Error()
@@ -380,7 +380,8 @@ func (fs *FilerServer) saveAsChunk(ctx context.Context, so *operation.StorageOpt
}
var uploadErr error
uploadResult, uploadErr, _ = uploader.Upload(ctx, reader, uploadOption)
uploadCtx := context.WithoutCancel(ctx)
uploadResult, uploadErr, _ = uploader.Upload(uploadCtx, reader, uploadOption)
if uploadErr != nil {
return uploadErr
}
@@ -436,7 +437,7 @@ func (fs *FilerServer) mkdir(ctx context.Context, w http.ResponseWriter, r *http
Name: util.FullPath(path).Name(),
}
if dbErr := fs.filer.CreateEntry(ctx, entry, false, false, nil, false, so.MaxFileNameLength); dbErr != nil {
if dbErr := fs.filer.CreateEntry(context.WithoutCancel(ctx), entry, false, false, nil, false, so.MaxFileNameLength); dbErr != nil {
replyerr = dbErr
filerResult.Error = dbErr.Error()
glog.V(0).InfofCtx(ctx, "failing to create dir %s on filer server : %v", path, dbErr)