﻿# TOO_MANY_JOINED_REQUESTS — too many callbacks are already waiting for this transaction

On the in-tree backends (memory, SQLite, PostgreSQL) callbacks of one transaction are served **one at a time**: each holds the transaction for the time th…

<em>cyoda-go version <a href="https://github.com/Cyoda/cyoda-go/releases/tag/v0.9.0">0.9.0</a></em>

# errors.TOO_MANY_JOINED_REQUESTS

## NAME

TOO_MANY_JOINED_REQUESTS — the node refused a request made under a transaction token because that transaction already has as many callbacks waiting as it may have.

## SYNOPSIS

HTTP: `503` `Service Unavailable`. Retryable: `yes`.

## DESCRIPTION

On the in-tree backends (memory, SQLite, PostgreSQL) callbacks of one transaction are served **one at a time**: each holds the transaction for the time the server works on it, so callbacks sent in parallel are served in turn. The queue behind the callback being served is bounded by `CYODA_CALLOUT_JOINED_MAX_WAITERS` (default `128`), and a callback that arrives when the queue is full is refused rather than parked. The message does not carry the figure — see the rule below.

That setting bounds how many callbacks may queue, not how many bytes they hold. Every callback waiting its turn holds its whole request in memory until it runs, and it may wait for as long as the callout lasts; that request is capped at a fixed 10 MiB, which no setting moves, and the queue as a whole has no byte ceiling at all. The cap is also a reading rather than a reservation, so callbacks that arrive together can all pass it and buffer their requests before taking their places.

The refused callback changes nothing: it is turned away before its request body is read where the door allows that, and otherwise before it takes the transaction, so it reads and writes nothing and leaves no trace. The callback holding the transaction and the ones already queued are unaffected, and the transaction itself carries on.

Retryable, and the action is the usual one for a capacity refusal: back off briefly and send the callback again. A callback refused because another callback of the transaction is paused in a callout of its own gets `TRANSACTION_BUSY` instead, which is retryable too; see `errors.TRANSACTION_BUSY`. Firing many callbacks at one transaction at once buys no speed, because they are served in turn either way — the refusal enforces that rather than introducing it. A processor that lets this error escape fails its callout, and the operation is rolled back, so a compute member should handle it rather than propagate it.

The message withholds the cap deliberately, under the rule this server's refusals follow: a refusal names the figure the caller can work within, and withholds one that only reads how loaded the node is. Knowing the cap would change nothing a caller does — back off and retry is the same action at any value — while the number itself is operator information. `JOINED_RESPONSE_TOO_LARGE` names its ceiling for the opposite reason: a caller can page a read under a byte budget.

Frequent occurrences mean a compute member is submitting callbacks far faster than the server can serve them. Slow the member down, or have an operator raise `CYODA_CALLOUT_JOINED_MAX_WAITERS`, at the cost of memory held on the owning node while the transaction is held.

See `cyoda help config grpc` for the variable.

## SEE ALSO

- errors
- errors.SEARCH_QUEUE_FULL
- errors.CALLOUT_SUPERSEDED
- errors.TRANSACTION_BUSY
- config

## See also

- [`cyoda help errors`](/help/errors/) — Every error response from the Cyoda REST API carries a structured `errorCode` in the `properties` object. Multiple codes may share the same HTTP status. Programmatic handling keys on `errorCode`, not HTTP status.
- [`cyoda help errors SEARCH_QUEUE_FULL`](/help/errors/search_queue_full/) — `POST /api/search/async/{entityName}/{modelVersion}` runs on a bounded worker pool: a fixed number of workers drain a fixed-capacity queue. Submission fails fast with this error rather than blocking the request or spawning an unbounded goroutine per submission. The rejected submit leaves nothing behind — no job row, no id to poll.
- [`cyoda help errors CALLOUT_SUPERSEDED`](/help/errors/callout_superseded/) — A compute node receives a transaction token with each processor, criterion or function request, and presents it on the API requests it makes while it works. The token is valid for that one request on that one compute node. This error fires when the token is presented after cyoda gave the same work to another compute node — because this one did not answer within its answer limit, or its connection dropped — or after the request ended: answered, failed or abandoned. The transaction itself is still open; once it has ended the answer is `TRANSACTION_NOT_FOUND` instead.
- [`cyoda help errors TRANSACTION_BUSY`](/help/errors/transaction_busy/) — On the in-tree backends (memory, SQLite, PostgreSQL) the callbacks of one transaction are served one at a time. A callback runs a write whose workflow may call out to a compute member again. While that inner callout is waiting for its answer, the callback is paused: it lets the transaction go, so that the callbacks of the inner callout can run, and only those. A sibling callback of the same transaction that arrives in that time is refused at once with this code, instead of waiting behind the paused one; so is a sibling already waiting when the pause begins. A callback that belongs to the paused callback's own callout is not a sibling and is admitted. A location-independent backend runs callbacks at the same time and never answers this code.
- [`cyoda help config`](/help/config/) — Environment variables beat default values. The `_FILE` suffix variant takes precedence over the plain variable when both are set — for example, `CYODA_POSTGRES_URL_FILE=/etc/secrets/db-url` wins over `CYODA_POSTGRES_URL`. There are no command-line flags for configuration values; env vars are the sole configuration surface.

## Raw formats

- [`/help/errors/too_many_joined_requests.json`](/help/errors/too_many_joined_requests.json) — full descriptor (matches `GET /help/{topic}` envelope)
- [`/help/errors/too_many_joined_requests.md`](/help/errors/too_many_joined_requests.md) — body only