Closed tpaschalis closed 2 months ago
Attention: Patch coverage is 92.30769%
with 1 line
in your changes missing coverage. Please review.
Project coverage is 76.89%. Comparing base (
ed38d5f
) to head (d016331
). Report is 5 commits behind head on main.
Files with missing lines | Patch % | Lines |
---|---|---|
client/internal/packagessyncer.go | 80.00% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I've rebased main and fixed the conflict from a recent PR, let me know what you think! 🙌
Thanks for your patience @tpaschalis
This PR revives work done in previous PRs (#118, #120) to make sure that only a single package syncing operation is ever in flight and also adds a test.
The previous PRs did not account for needing to also protect
initStatuses
andSetPackageStatuses
, so that's why the Lock and Unlock statements are not just paired in doSync. If you think the intent would be clearer using a sync.WaitGroup, let me know.The new test makes sure that the mutex correctly protects the local storage; if we comment out the calls to Lock/Unlock and run the test with the
-race
flag we can see the race condition taking placeFixes #84