Skip to content

Commit

Permalink
Don't update store index if we failed to upload blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
DanEngelbrecht committed Jul 8, 2024
1 parent e53da81 commit 0da507a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
##
- **ADDED** New option to control the number of worker thread in remote stores to avoid overflowing the network connection.
-- `--remote-worker-count` Set number of workers created for the remote store, defaults to match number of logical CPUs with upper limit of 8 for networked remote stores
- **FIXED** Don't update store index if we failed to upload blocks

## v0.4.3
- **CHANGED** For multi-source downsync/get the separator for paths is changed to | to avoid problems with path that contains spaces
Expand Down
9 changes: 9 additions & 0 deletions remotestore/remotestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,10 @@ func contentIndexWorker(

select {
case <-flushMessages:
if err != nil {
flushReplyMessages <- err
continue
}
if len(addedBlockIndexes) > 0 && accessType != ReadOnly {
newStoreIndex, err := addBlocksToRemoteStoreIndex(ctx, s, client, addedBlockIndexes)
if err != nil {
Expand Down Expand Up @@ -915,6 +919,11 @@ func contentIndexWorker(
}
}

if err != nil {
storeIndex.Dispose()
return err
}

if accessType == ReadOnly {
storeIndex.Dispose()
return nil
Expand Down

0 comments on commit 0da507a

Please sign in to comment.