summaryrefslogtreecommitdiffstats
path: root/src/db/model
diff options
context:
space:
mode:
authoraur-build <aur-build@localhost>2026-11-19 15:32:44 +0000
committeraur-build <aur-build@localhost>2026-11-19 15:32:44 +0000
commitec80c312b80ba51271fff0548c6d1e293d373455 (patch)
tree41bfc268c01f2a14b88fa90a71f08e855471cedf /src/db/model
parent32eaaeae9e0fe2c2285fb79efa0e579150d8bd83 (diff)
downloadaur-build-ec80c312b80ba51271fff0548c6d1e293d373455.tar.gz
aur-build-ec80c312b80ba51271fff0548c6d1e293d373455.zip
sandbox: the agent listener belongs to the process, not to a build
`Ctx::new` constructed a backend for every build, and constructing a remote backend bound the agent listener. With a fixed `listen` — which is what any real deployment configures, since the operator has to tell the agents where to dial — the second concurrent build died of EADDRINUSE. A build failing for a reason that had nothing to do with its package is the worst kind of flake: it looks like the package's fault. `RemoteBackend::bind` now shares one bound listener per `(address, token)` for the life of the process, and hands each backend a clone of the dial-in queue. That is also what `remote` already meant: an agent dials in when the operator boots one and whichever build is waiting takes it. The token is part of the key deliberately — two tokens cannot share a listener, and quietly reusing the first one's would be a fail-open surprise, so the second bind is attempted and fails loudly instead. Backend construction moved out of `Ctx` into `sandbox::backend_for`, so "which backend" has exactly one answer and the validation guard travels with it. Tests cover the shared listener, the shared queue (the *second* backend takes the dial-in), the two-token refusal, and two concurrent `Ctx`es on one address — with an assertion that a raw second bind still fails, so the test cannot rot into proving nothing.
Diffstat (limited to 'src/db/model')
0 files changed, 0 insertions, 0 deletions