Repository navigation
fix(runnerhub): scope Runner-originated binding calls to the session's tenant (RIG-4146) - #1463
Merged
Merged
Conversation
…s tenant (RIG-4146) Runners are shared across tenants, so the Runner door carries no tenant and binding reads/deletes on deliverAck, forgeNotificationAck and dropLostSession ran under the bootstrap tenant. Resolve the session's tenant under the system role (SessionBindingTenant), then act under WithTenant. A session bound in two tenants on one runner is refused. Co-authored-by: Matt Wilkinson <matt@rigel.build>
|
😎 This pull request was merged. |
|
Compass engineering docs preview: https://compass-server-rig-4146-runn.compass-eng-docs.pages.dev Deployed from |
rigel-mintaka
marked this pull request as ready for review
October 2, 2026 01:19
This was referenced Oct 2, 2026
mattwilkinsonn
added this pull request to stack #1467
October 2, 2026 03:19
mattwilkinsonn
approved these changes
Oct 2, 2026
|
This pull request was merged into |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is part of a stack containing 4 PRs:
mainFixes RIG-4146 (Matt's ruling: option 2).
Problem
Runners are shared across tenants, so the Runner door context has no tenant. Binding reads and deletes on
deliverAck,forgeNotificationAckanddropLostSessiontherefore ran under the bootstrap tenant. For an agent in another tenant, a cold binding read failed closed (no ack, no wake), and the durable delete matched nothing.Change
store.SessionBindingTenant(session, runner)is a read under the system role. It is filtered on both session and runner. It returns ErrConflict when two tenants bind the same session on one runner, so it never picks a tenant arbitrarily.Hub.runnerSessionCtxresolves that tenant and returnsWithTenant(ctx). A miss or a store fault keeps today's context, which still fails closed. A conflict refuses the call.deliverAck,forgeNotificationAckanddropLostSessionrun under the scoped context.Tests
TestDropLostSessionScopesToTheSessionTenant(runnerhub pgtest): a tenant-B session read cold is released durably and woken. WithrunnerSessionCtxdisabled it fails: "lost = [], want [...]: the tenant-B session was not resolved".TestSessionBindingTenantResolvesAcrossTenantsUnderSystemRole(store pgtest) covers the found, foreign-runner and conflict cases.-race). sqlc drift is clean. Lint reports 0 issues in the touched packages.Known follow-ups (low)