Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F/censusdb race #1175

Merged
merged 3 commits into from
Oct 31, 2023
Merged

F/censusdb race #1175

merged 3 commits into from
Oct 31, 2023

Conversation

p4u
Copy link
Member

@p4u p4u commented Oct 31, 2023

see commit message

@lucasmenendez if you are using censusdb, once you upgrade to the code containing this PR, you should call censusdb.Unload() after every Load() to release the lock.

p4u added 2 commits October 30, 2023 18:44
We added a new global lock for censusDB. Before, the lock only affected
the individual trees, however as censusDB is able to load the same tree
twice (in case of paralel calls to the API census endpoints), a write
operation could be done racy to the same tree database.

Now Censusdb requires to call Unload() after Load() to release the lock.

In addition, extend the import/export methods to allow IPFS transfers.

Signed-off-by: p4u <[email protected]>
@p4u p4u force-pushed the f/censusdb_race branch from 6684615 to 0971abf Compare October 31, 2023 11:06
@coveralls
Copy link

coveralls commented Oct 31, 2023

Pull Request Test Coverage Report for Build 6708329548

  • 55 of 186 (29.57%) changed or added relevant lines in 6 files are covered.
  • 13 unchanged lines in 7 files lost coverage.
  • Overall coverage decreased (-0.3%) to 61.511%

Changes Missing Coverage Covered Lines Changed/Added Lines %
apiclient/client.go 0 3 0.0%
data/datamocktest.go 0 6 0.0%
cmd/end2endtest/census.go 0 12 0.0%
api/censusdb/censusdb.go 18 69 26.09%
api/censuses.go 27 86 31.4%
Files with Coverage Reduction New Missed Lines %
api/censuses.go 1 51.72%
cmd/end2endtest/census.go 1 9.86%
api/accounts.go 2 47.39%
apiclient/account.go 2 40.92%
censustree/censustree.go 2 73.66%
vochain/state/cache.go 2 61.54%
cmd/end2endtest/account.go 3 68.72%
Totals Coverage Status
Change from base Build 6692851655: -0.3%
Covered Lines: 14220
Relevant Lines: 23118

💛 - Coveralls

@p4u p4u force-pushed the f/censusdb_race branch from 9a0c120 to ffd23bf Compare October 31, 2023 15:04
@p4u p4u merged commit 4436efc into main Oct 31, 2023
11 checks passed
@p4u p4u deleted the f/censusdb_race branch October 31, 2023 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants