Skip to content

🐛 fix(hub): stop a racing heartbeat from re-inserting an activity digest after forget - #16044

Merged
hivecommons-hive[bot] merged 2 commits into
v5from
scanner/fix-16010
Oct 31, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
v5from
scanner/fix-16010

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

The heartbeat handler recorded the activity digest after releasing s.mu, while removeRegistryEntry/handleRegistryDelete forgot the digest before taking s.mu. A beat that passed the registry update concurrently with a delete could record after the purge, leaving a stale digest until the 24h sweep.

Fix: option (b). record now runs before s.mu is released in the heartbeat, and forget runs inside s.mu after the registry removal in both delete paths. A beat therefore either records before the delete (and is purged) or sees no entry afterwards and the registry check never lets it record. activityStore.mu is a leaf lock that never takes s.mu, so nesting it under s.mu cannot deadlock; the added work under s.mu is one short map update.

Test: deterministic, no sleeps; holds the store busy and asserts the delete waits on it while holding s.mu.

Closes #16010

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

…t after forget

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 31, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kellyaa for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 31, 2026
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#16049 ✨ feat(hub): carry bounded activity events through the heartbeat and hub ring same files src/pkg/hub/server.go

@hivecommons-hive

hivecommons-hive Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

hive/awaiting-ci: merge was refused at e41968e with 405 "Required status check 'Sign-off survives the squash' is expected" — the head carried superseded CANCELLED runs of that required check next to its SUCCESS, and GitHub's rollup read it as not passing. Pushed an empty signed commit to re-trigger the checks; CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Evidence bundle `#160448943133` sha256:b331ef84618bfc5a1ed089feb5383a92b108f137dd7c27b733477abe92b9ee1b — download from the dashboard or `hivectl review evidence #16044`.

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 31, 2026
The 'Sign-off survives the squash' check on e41968e has superseded
cancelled runs alongside its green run, and GitHub's required-check
rollup keeps reporting it as expected, so the PR cannot merge at that
head. No code change.

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 31, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit b4a3061 into v5 Oct 31, 2026
83 of 88 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-16010 branch October 31, 2026 15:00
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

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

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/M Denotes a PR that changes 30-99 lines, ignoring generated files. stage/050-review-pending Review swarm requested; awaiting a verdict for the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[reviewer] Review backlog (intent-alignment): Heartbeat racing a delete can re-insert a digest after forget

0 participants