Repository navigation
v2.25.10
Patch release. A pinned_client pull consumer's iterator now keeps the group's pin when a run ends before its first pull retires (#208). The next handle() on the same iterator resends the pin, instead of waiting out the server's priority_timeout.
Upgrading is recommended for applications that call handle() again on the same iterator of a pinned_client priority group: restarting after a failure, after stop(), or after the client's drain(). There are no API changes. An application that builds a new iterator for each run starts without a pin, as before.
Fixed
- A grouped run keeps the pin it received (#208). The iterator took a
pinned_clientgroup's pin only from a batch the run retired or handed to the handler.- Who was hit: a run that ended while its first pull, or the first after a 423, still held messages. Endings that did this:
- a fatal
-ERR - the connection lost with
waitForReconnect: false - another subscription's handler under
handlerErrorsFailOperations - a rejected inbox
stop(),disconnect()or the client'sdrain()
- a fatal
- The effect: the iterator was left without the pin. The next
handle()pulled without it, and the server held that pull, and every other client of the group, until the pin'spriority_timeouthad passed (two minutes by default). - The fix: the pull-inbox router now remembers the pin as each message arrives, before it routes the message. Every way a run ends keeps it, including
stop()followed byhandle()while the old pull's write is still completing. - Related changes:
- Delivery no longer takes a pin from a buffer, so an old message cannot restore a pin that a 423 rejected later.
- A run pulls one request at a time until the first batch under its pin has been delivered. A run that starts with an inherited pin pipelines at once.
- Each pull records the pin it sent. A 423 clears the live pin only when it is still that one, so a late 423 for an older pin leaves a newer pin alone.
- Measured against nats-server 2.12: the report measured the restart's message 7.5 s late, with
priority_timeout8 s. The new live test gets it at once, under the original pin.
- Who was hit: a run that ended while its first pull, or the first after a 423, still held messages. Endings that did this:
Before upgrading
- A message carrying a newer pin than the one held now replaces it. The newest pin received on a connection is the server's current one. Before, the first pin captured was kept.
- A 423 that answers a pull sent with an older pin no longer clears a newer one.
- Depth is unchanged in practice: a grouped run still pulls serially until the first batch under its pin retires, as before.
Quality gates
- PHPStan level 8.
- 3436 unit tests (with data sets) on PHP 8.2 to 8.5, 159 live integration tests and 49 Behat scenarios. All runnable examples pass.
codecov/patch100%: every changed line is covered. Total coverage 99.03%.- Infection covered MSI 92.55% (90% floor enforced in CI). It skipped 4764 of the 8790 mutants it generated as too slow, so the score does not include them. No mutant escaped in the changed pin code.
- New
PullConsumerPinRetentionTest, 20 cases: the issue's 19, of which 11 fail on 2.25.9, plus a case for a run that inherited the pin and loses it to another run. Nine broken variants of the fix each fail at least one case. - New live test against a
pinned_clientconsumer, with two cases: stop, and another handler failing the run. Both are served at once under the original pin; on 2.25.9 both are still waiting at the test's 10 s bound.
The full record is in the CHANGELOG.