Skip to content

Commit

Permalink
Fix deadlock with unclosed pipe of uploaded tarball (#399)
Browse files Browse the repository at this point in the history
This problem does not affect buffered storages (like AWS) but can stuck unbuffered (like GCP).
Also this commit fixes problem of premature timeout in GCP storage during ReadObject().
This commit should help to resolve #266
  • Loading branch information
x4m authored and g0djan committed Sep 4, 2019
1 parent 8930020 commit a2c52c0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,7 @@
[[constraint]]
branch = "master"
name = "github.com/tinsane/tracelog"

[[constraint]]
revision = "94d6f74dd32347e5c486253b623c49d4d7216e17"
name = "github.com/tinsane/storages"
2 changes: 2 additions & 0 deletions internal/storage_tar_ball.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ func (tarBall *StorageTarBall) startUpload(name string, crypter crypto.Crypter)
if err != nil {
tracelog.ErrorLogger.Printf("upload: could not upload '%s'\n", path)
tracelog.ErrorLogger.Printf("%v\n", err)
err = pipeReader.Close()
tracelog.ErrorLogger.FatalfOnError("Failed to close pipe: %v", err)
}
}()

Expand Down

0 comments on commit a2c52c0

Please sign in to comment.