use context.WithoutCancel to avoid context cancellation when the client connection is closed
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package weed_server
|
package weed_server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -46,7 +47,8 @@ func (vs *VolumeServer) PostHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret := operation.UploadResult{}
|
ret := operation.UploadResult{}
|
||||||
isUnchanged, writeError := topology.ReplicatedWrite(ctx, vs.GetMaster, vs.grpcDialOption, vs.store, volumeId, reqNeedle, r, contentMd5)
|
// use context.WithoutCancel to avoid context cancellation when the client connection is closed
|
||||||
|
isUnchanged, writeError := topology.ReplicatedWrite(context.WithoutCancel(ctx), vs.GetMaster, vs.grpcDialOption, vs.store, volumeId, reqNeedle, r, contentMd5)
|
||||||
if writeError != nil {
|
if writeError != nil {
|
||||||
writeJsonError(w, r, http.StatusInternalServerError, writeError)
|
writeJsonError(w, r, http.StatusInternalServerError, writeError)
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user