Skip to content

fix(security): claim a bus task only when a worker is free (LSR-075) - #70

Merged
homer6 merged 1 commit into
devfrom
fix/lsr-075-bus-backpressure
Nov 16, 2026
Merged

homer6 merged 1 commit into
devfrom
fix/lsr-075-bus-backpressure

Conversation

@homer6

@homer6 homer6 commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

What: The bus consumer claims a task only when a worker is free to run it, and one customer can no longer take every worker.
Why: Finding LSR-075 (#33) of the Lake pre-launch security review: every received task was claimed and queued, so one tenant's burst held claimed tasks (with their credentials) in memory and starved the others. Part of the open-source release's security gate, https://github.com/oramasearch/orama-bridge/issues/273.
How: Ported agent-ask-orama's consumer, oramasearch/agent-ask-orama#47: work and its worker slots; this agent's run_task is unchanged.

Refs #33

Changes

  • lake_bus.py: work claims only when a worker is free; nothing is received while all are busy; AGENT_BUS_WORKERS (4) and AGENT_BUS_TENANT_WORKERS (one fewer); at most 256 dispatch rows wait. receive takes the long poll's wait_ms.
  • tests/test_bus_backpressure.py: ported.
  • README.md: the limits and settings.

Proof

Not run: per Steve, 2026-11-14, tests run at review and release time, after the epic's work.

Ported from agent-ask-orama#47: receive nothing while every worker is busy, leave tasks this replica
cannot run unclaimed on the bus, cap one customer at AGENT_BUS_TENANT_WORKERS workers, and keep at
most 256 dispatch rows waiting. run_task is unchanged. README and tests/test_bus_backpressure.py.

Refs #33
@homer6

homer6 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Merged into dev as a merge commit (fab20b19) on Steve's review (2026-11-15). Low risk, on Steve's 2026-11-15 instruction to merge the low-risk PRs. Not built or tested in review (tests run at the release cut).

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