Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7a59f5a

Browse files
authored
Ignore "Close" error when uploading container blob (#34620)
1 parent6d0b240 commit7a59f5a

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

‎routers/api/packages/container/container.go‎

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -403,12 +403,7 @@ func EndUploadBlob(ctx *context.Context) {
403403
}
404404
return
405405
}
406-
doClose:=true
407-
deferfunc() {
408-
ifdoClose {
409-
uploader.Close()
410-
}
411-
}()
406+
deferuploader.Close()
412407

413408
ifctx.Req.Body!=nil {
414409
iferr:=uploader.Append(ctx,ctx.Req.Body);err!=nil {
@@ -441,11 +436,10 @@ func EndUploadBlob(ctx *context.Context) {
441436
return
442437
}
443438

444-
iferr:=uploader.Close();err!=nil {
445-
apiError(ctx,http.StatusInternalServerError,err)
446-
return
447-
}
448-
doClose=false
439+
// There was a strange bug: the "Close" fails with error "close .../tmp/package-upload/....: file already closed"
440+
// AFAIK there should be no other "Close" call to the uploader between NewBlobUploader and this line.
441+
// At least it's safe to call Close twice, so ignore the error.
442+
_=uploader.Close()
449443

450444
iferr:=container_service.RemoveBlobUploadByID(ctx,uploader.ID);err!=nil {
451445
apiError(ctx,http.StatusInternalServerError,err)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp