Skip to content

[WIP] leakybucket: don't let a blackhole cleanup delete the next bucket - #4772

Open
sabban wants to merge 1 commit into
masterfrom
fix/blackhole-cleanup-live-bucket
Open

sabban wants to merge 1 commit into
masterfrom
fix/blackhole-cleanup-live-bucket

Conversation

@sabban

@sabban sabban commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

A blackholed overflow sends a cleanup event, handled later by the output routine. By then a new bucket may hold the same key: Delete removed it, splitting the burst between an orphaned bucket and a fresh one, and the overflow was lost (intermittent hubtest failures, e.g. paperless-ngx-bf).

Only delete the bucket if it has stopped.

What and why

Fixes one of the races that happens on the hub side.

How it was tested


Checklist

  • One concern only.
  • No break to LAPI/CAPI payloads, database schema, config keys, or cscli -o json|raw output.
  • A human has reviewed this diff line by line.
  • A human has tested this change, not only an agent.

AI assistance used:

A blackholed overflow sends a cleanup event, handled later by the output
routine. By then a new bucket may hold the same key: Delete removed it,
splitting the burst between an orphaned bucket and a fresh one, and the
overflow was lost (intermittent hubtest failures, e.g. paperless-ngx-bf).

Only delete the bucket if it has stopped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

@sabban: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.

  • /kind feature
  • /kind enhancement
  • /kind refactoring
  • /kind fix
  • /kind chore
  • /kind dependencies
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

@github-actions

Copy link
Copy Markdown

@sabban: There are no area labels on this PR. You can add as many areas as you see fit.

  • /area agent
  • /area local-api
  • /area cscli
  • /area appsec
  • /area security
  • /area configuration
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

@sabban sabban changed the title leakybucket: don't let a blackhole cleanup delete the next bucket [WIP] leakybucket: don't let a blackhole cleanup delete the next bucket Oct 21, 2026
@sabban

sabban commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

/kind fix
/area agent

@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 71.83%. Comparing base (f64b626) to head (6591493).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
pkg/leakybucket/bucketstore.go 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4772      +/-   ##
==========================================
+ Coverage   71.75%   71.83%   +0.07%     
==========================================
  Files         544      545       +1     
  Lines       37109    37171      +62     
==========================================
+ Hits        26628    26702      +74     
+ Misses      10480    10468      -12     
  Partials        1        1              
Flag Coverage Δ
bats 45.28% <0.00%> (+0.05%) ⬆️
unit-linux 49.79% <88.88%> (+0.31%) ⬆️
unit-windows 37.79% <11.11%> (+0.31%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant