filecoin-project / go-f3

Golang implementation of Fast Finality for Filecoin (F3)
Apache License 2.0
11 stars 7 forks source link

Avoid holding the F3 lock while starting it #677

Closed Stebalien closed 1 month ago

Stebalien commented 1 month ago

This was causing some testing issues because, e.g., calls to IsRunning would block while the startup logic was fetching the initial power table.

Stebalien commented 1 month ago

I'm not a huge fan of adding another layer, but we were starting to have a lot of random adjacent services and this lets us atomically swap them out.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 59.13978% with 38 lines in your changes missing coverage. Please review.

Project coverage is 76.31%. Comparing base (b5667dd) to head (5d66683). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
f3.go 59.13% 19 Missing and 19 partials :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/filecoin-project/go-f3/pull/677/graphs/tree.svg?width=650&height=150&src=pr&token=6uD131t7gs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=filecoin-project)](https://app.codecov.io/gh/filecoin-project/go-f3/pull/677?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=filecoin-project) ```diff @@ Coverage Diff @@ ## main #677 +/- ## ========================================== - Coverage 76.67% 76.31% -0.36% ========================================== Files 65 65 Lines 5419 5388 -31 ========================================== - Hits 4155 4112 -43 - Misses 873 881 +8 - Partials 391 395 +4 ``` | [Files with missing lines](https://app.codecov.io/gh/filecoin-project/go-f3/pull/677?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=filecoin-project) | Coverage Δ | | |---|---|---| | [f3.go](https://app.codecov.io/gh/filecoin-project/go-f3/pull/677?src=pr&el=tree&filepath=f3.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=filecoin-project#diff-ZjMuZ28=) | `63.76% <59.13%> (-8.13%)` | :arrow_down: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/filecoin-project/go-f3/pull/677/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=filecoin-project)