Skip to content

Commit

Permalink
Set limiter before context in upload one
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamishpk committed Feb 16, 2024
1 parent f1f75bc commit a1d47e2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 11.7.4
--------------
* Set limiter before context in elan client

Version 11.7.3
--------------
* Bump timeout for uploadIfMissing to handle actions with large output
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11.7.3
11.7.4
4 changes: 2 additions & 2 deletions elan/rpc/eclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ func (e *elanClient) uploadOne(entry *uploadinfo.Entry, compressor pb.Compressor
}
compressed := compressor != pb.Compressor_IDENTITY
key := e.s.compressedKey("cas", entry.Digest.ToProto(), compressed)
ctx, cancel := context.WithTimeout(context.Background(), e.timeout)
defer cancel()
e.s.limiter <- struct{}{}
defer func() { <-e.s.limiter }()
ctx, cancel := context.WithTimeout(context.Background(), e.timeout)
defer cancel()
if len(entry.Contents) > 0 {
if compressed {
entry.Contents = e.s.compressor.EncodeAll(entry.Contents, make([]byte, 0, entry.Digest.Size))
Expand Down

0 comments on commit a1d47e2

Please sign in to comment.