Skip to content

fix(ci): bound queue DB connections to stop E2E 1040 stalls - #700

Merged
behinddwalls merged 1 commit into
mainfrom
preetam/fix-main-ci-test-boundaries
Sep 11, 2026
Merged

fix(ci): bound queue DB connections to stop E2E 1040 stalls#700
behinddwalls merged 1 commit into
mainfrom
preetam/fix-main-ci-test-boundaries

Conversation

@behinddwalls

@behinddwalls behinddwalls commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Why?

Tenant-scoped reconciliation fans out one goroutine per tenant per subscription tick. With database/sql's unlimited open-connection default, the E2E stack opened more sockets than MySQL's ~151-connection ceiling, returned Error 1040, and stalled pipeline progress until Bazel timed out. Gateway integration also published logs under a tenant that was not in MQ_TENANTS, so the consumer never saw them.

What?

  • Apply QUEUE_MYSQL_MAX_OPEN_CONNECTIONS (default 16) on each service-owned queue *sql.DB, and keep that many connections idle so the cap does not churn sockets.
  • Point the gateway log-consumer integration at the configured test-queue tenant and scope the land-message lookup by tenant.
  • Upload Bazel test.log files on failure for every CI test job. Uploads authenticate with the Actions runtime token, so the workflow keeps its contents: read-only GITHUB_TOKEN.

Test Plan

./tool/bazel test //service/messagequeue:go_default_test
./tool/bazel test //test/integration/submitqueue/gateway:go_default_test --sandbox_writable_path="$HOME/.docker/buildx"
./tool/bazel test //test/e2e/submitqueue:go_default_test --sandbox_writable_path="$HOME/.docker/buildx" (167s, then 161s)
./tool/bazel test //test/e2e/submitqueue:go_default_test --test_filter='TestGitMergeE2E' --sandbox_writable_path="$HOME/.docker/buildx"
docker run --rm -v "$PWD:/src:ro" -w /src ghcr.io/zizmorcore/zizmor:1.25.2 --persona regular . — no findings
make fmt && make gazelle && make tidy

@behinddwalls
behinddwalls marked this pull request as ready for review September 11, 2026 04:52
@behinddwalls
behinddwalls requested review from a team and sbalabanov as code owners September 11, 2026 04:52
## Summary

### Why?

Tenant-scoped reconciliation fans out one goroutine per tenant per subscription tick. With `database/sql`'s unlimited open-connection default, the E2E stack opened more sockets than MySQL's ~151-connection ceiling, returned Error 1040, and stalled pipeline progress until Bazel timed out. Gateway integration also published logs under a tenant that was not in `MQ_TENANTS`, so the consumer never saw them.

### What?

- Apply `QUEUE_MYSQL_MAX_OPEN_CONNECTIONS` (default 16) on each service-owned queue `*sql.DB`, and keep that many connections idle so the cap does not churn sockets.
- Point the gateway log-consumer integration at the configured `test-queue` tenant and scope the land-message lookup by tenant.
- Upload Bazel `test.log` files on failure for every CI test job. Uploads authenticate with the Actions runtime token, so the workflow keeps its `contents: read`-only `GITHUB_TOKEN`.

## Test Plan

✅ `./tool/bazel test //service/messagequeue:go_default_test`
✅ `./tool/bazel test //test/integration/submitqueue/gateway:go_default_test --sandbox_writable_path="$HOME/.docker/buildx"`
✅ `./tool/bazel test //test/e2e/submitqueue:go_default_test --sandbox_writable_path="$HOME/.docker/buildx"` (167s, then 161s)
✅ `./tool/bazel test //test/e2e/submitqueue:go_default_test --test_filter='TestGitMergeE2E' --sandbox_writable_path="$HOME/.docker/buildx"`
✅ `docker run --rm -v "$PWD:/src:ro" -w /src ghcr.io/zizmorcore/zizmor:1.25.2 --persona regular .` — no findings
✅ `make fmt && make gazelle && make tidy`

Co-authored-by: Cursor <cursoragent@cursor.com>
@behinddwalls
behinddwalls force-pushed the preetam/fix-main-ci-test-boundaries branch from b828467 to e15dc9c Compare September 11, 2026 04:57
@behinddwalls
behinddwalls merged commit 835d602 into main Sep 11, 2026
15 checks passed
@behinddwalls
behinddwalls deleted the preetam/fix-main-ci-test-boundaries branch September 11, 2026 05:04
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.

1 participant