Skip to content

Start policer at random offset#3879

Open
End-rey wants to merge 3 commits intomasterfrom
start-poicer-at-random-offset
Open

Start policer at random offset#3879
End-rey wants to merge 3 commits intomasterfrom
start-poicer-at-random-offset

Conversation

@End-rey
Copy link
Contributor

@End-rey End-rey commented Mar 17, 2026

Closes #3765.

@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

❌ Patch coverage is 84.90566% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.17%. Comparing base (12a6dcf) to head (e0be392).

Files with missing lines Patch % Lines
pkg/local_object_storage/engine/list.go 0.00% 4 Missing ⚠️
pkg/services/policer/process.go 90.24% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3879      +/-   ##
==========================================
+ Coverage   26.12%   26.17%   +0.04%     
==========================================
  Files         675      675              
  Lines       43892    43926      +34     
==========================================
+ Hits        11468    11497      +29     
- Misses      31361    31364       +3     
- Partials     1063     1065       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@End-rey End-rey force-pushed the start-poicer-at-random-offset branch 2 times, most recently from 5bd8af8 to e606562 Compare March 17, 2026 14:50
End-rey added 2 commits March 17, 2026 17:51
This avoids leaking background resources between test runs and ensures worker
goroutines are cleaned up on shutdown.

Signed-off-by: Andrey Butusov <andrey@nspcc.io>
Replace the separate inWork/add sequence with atomic tryAdd. This closes a race
where the same object could be scheduled more than once if concurrent checks
observed it as not yet in work.

Signed-off-by: Andrey Butusov <andrey@nspcc.io>
Start each policer cycle from a random CID/OID cursor instead of always from the
beginning of local storage. A cycle now wraps once and finishes after the scan
passes the initial random address again. This spreads checks across different
parts of the object space after cluster-wide restarts and reduces duplicate work
between nodes.
Update policer tests to match the new cycle semantics and stop relying on
cleanCycle as a universal completion signal.

Closes #3765.

Signed-off-by: Andrey Butusov <andrey@nspcc.io>
@End-rey End-rey force-pushed the start-poicer-at-random-offset branch from e606562 to e0be392 Compare March 17, 2026 16:21
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.

Start policer at random offset

2 participants