filer write request use context without cancellation (#7567)
* filer use context without cancellation * pass along context
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user