berty / go-orbit-db

Go version of P2P Database on IPFS
https://berty.tech
Apache License 2.0
405 stars 55 forks source link

fix: race conditions in base_index and eventlogstore #71

Closed phanhuynhquy closed 3 years ago

phanhuynhquy commented 3 years ago

Signed-off-by: phanquy phanhuynhquy@gmail.com Some race conditions:

  1. In base_index : by default used in berty Message store - race condition happen when write new message and a replicate is on-going

  2. In eventLogStore: when error happen in Stream() - no close channel was made, this will block List(). With this change - in case of error happen, maybe case err := <-errChan: will never be executed.

codecov[bot] commented 3 years ago

Codecov Report

Merging #71 into master will decrease coverage by 1.56%. The diff coverage is 11.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #71      +/-   ##
==========================================
- Coverage   67.67%   66.10%   -1.57%     
==========================================
  Files          29       29              
  Lines        2410     2083     -327     
==========================================
- Hits         1631     1377     -254     
+ Misses        564      494      -70     
+ Partials      215      212       -3     
Flag Coverage Δ
#unittests 66.10% <11.11%> (-1.57%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
stores/basestore/base_index.go 0.00% <0.00%> (ø)
stores/eventlogstore/log.go 69.38% <20.00%> (-4.25%) :arrow_down:
stores/operation/operation.go 76.47% <0.00%> (-6.87%) :arrow_down:
accesscontroller/utils/utils.go 36.00% <0.00%> (-4.75%) :arrow_down:
accesscontroller/manifest.go 71.60% <0.00%> (-4.40%) :arrow_down:
pubsub/oneonone/channel.go 67.21% <0.00%> (-4.22%) :arrow_down:
stores/kvstore/keyvalue.go 45.94% <0.00%> (-4.06%) :arrow_down:
utils/create_db_manifest.go 77.77% <0.00%> (-4.05%) :arrow_down:
address/address.go 82.60% <0.00%> (-3.11%) :arrow_down:
orbitdb.go 72.72% <0.00%> (-2.79%) :arrow_down:
... and 21 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 27b0d3d...9a5aef2. Read the comment docs.

github-actions[bot] commented 3 years ago

:tada: This PR is included in version 1.10.9 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: