storj/storagenode
Isaac Hess ed6b88a12d piecestore: update usage before completing upload (#3286)
The upload code currently updates the usage in a deferred call to saveOrder().
The consequence is that in the success case, the RPC is completed before
the usage has been updated.

This change repurposes the deferred call to update usage in the
failure case, while explicitly updating the usage before completing the
RPC.

This fixes some test flakiness when using dRPC. gRPC waits until the final status is written before a Recv call completes, and the final status is written by the server after the handler function has exited. In practice this means that the client is blocked until the defer call is also finished. So this change will not change performance at all.

It has two advantages:

(1) It fixes test flakiness

and, more importantly:

(2) reduces the chances that someone will accidentally write a flaky test in the future
2019-10-15 20:17:17 -06:00
..
bandwidth storagenode/storagenodedb: Migrate to separate dbs (#3081) 2019-09-23 12:36:46 -07:00
collector all: add archview annotations (#2964) 2019-09-10 16:24:16 +03:00
console web/storagenode: node status updated (#3220) 2019-10-11 19:28:47 +03:00
contact satellite/discovery: remove discovery related code (#3175) 2019-10-14 10:57:01 -04:00
gracefulexit storagenode/cmd: add exit-status command for graceful exit (#3264) 2019-10-15 18:07:32 -04:00
inspector satellite/discovery: remove discovery related code (#3175) 2019-10-14 10:57:01 -04:00
monitor satellite/discovery: remove discovery related code (#3175) 2019-10-14 10:57:01 -04:00
nodestats all: use pkg/rpc instead of pkg/transport 2019-09-25 15:37:06 -06:00
orders all: use pkg/rpc instead of pkg/transport 2019-09-25 15:37:06 -06:00
pieces storagenode/pieces: fix race condition in cache service (#2972) 2019-09-12 12:42:39 -04:00
piecestore piecestore: update usage before completing upload (#3286) 2019-10-15 20:17:17 -06:00
reputation all: add archview annotations (#2964) 2019-09-10 16:24:16 +03:00
retain satellite/metainfo: add commit interval to prevent long delays between order limit creation and segment commit (#3149) 2019-10-01 12:55:02 -04:00
satellites storagenode/storagenodedb: add SQL receiver logic for graceful exit (#3067) 2019-10-01 10:34:03 -04:00
storagenodedb storagenode/storagenodedb: add SQL receiver logic for graceful exit (#3067) 2019-10-01 10:34:03 -04:00
storageusage all: add archview annotations (#2964) 2019-09-10 16:24:16 +03:00
trust satellite/discovery: remove discovery related code (#3175) 2019-10-14 10:57:01 -04:00
operator.go storagenode/main: map aliases for kademlia config values (#3118) 2019-09-30 19:33:00 -04:00
peer.go storagenode/gracefulexit: Add graceful exit chore and worker. (#3262) 2019-10-15 11:29:47 -04:00