Skip to content

v2.24.6

Choose a tag to compare

@bpacholek bpacholek released this 10 Oct 07:10
· 109 commits to main since this release

Patch release. requestMany(), fetchBatch() and fetchNext() no longer lose what they received when their read meets a fatal server -ERR and the reconnect has already reopened the connection (#196).

Upgrading is recommended for applications that collect replies with requestMany() or fetch with fetchBatch() / fetchNext() with reconnect enabled, the default. There are no API changes.

Fixed

  • A collection keeps what it received past a fatal -ERR (#196). A fatal -ERR, such as Stale Connection or User Authentication Expired, comes right before the server closes the connection. The read that meets it recovers the connection within the operation's wait before it throws the server's error (#171). requestMany() and fetchBatch() return what they received when their read fails with the connection going. They judged that by the connection's state, though, and after a quick reconnect the state was already the new connection's: Open. So they threw the -ERR and lost what they had received. A scatter-gather never saw the replies it had collected. Fetched messages, which the server counted as delivered, came again only after ack_wait, or never on a consumer without acks or with max_deliver: 1. A complete result whose chunk also brought the -ERR was lost the same way, fetchNext() included.

    Both collections now ask whether the failure ended the connection, as the pull consumer engine does (#210), and return what they received. With nothing received they still throw the server's error. A failure that leaves the connection open still fails the collection: an -ERR the server keeps the connection open for, or a handler's exception with handlerErrorsFailOperations. The collection never sends its request or pull again on the new connection.

Before upgrading

  • A collection that has received something no longer throws a fatal -ERR its read met; it returns what it received. The connection events (Disconnected, Reconnected) announce the reconnect.

Quality gates

  • PHPStan level 8.
  • 3249 unit tests (with data sets) on PHP 8.2 to 8.5, 152 live integration tests and 48 Behat scenarios.
  • Statement coverage 98.83% from the unit suite (95% floor enforced in CI) and 98.89% combined (97% floor).
  • Infection covered MSI 93.23% over the 3651 mutants it ran (90% floor enforced in CI); it skipped 4938 of the 8589 it generated as too slow, so the score does not include them.
  • 35 new unit cases: the 9 regression cases fail on 2.24.5, and the 26 guards pass on both.
  • On the changed lines, with a 120 s per-mutant budget: 27 mutants, 18 killed and none escaped. Every mutant of the two changed conditions was killed; the 9 skipped for time mutate the enclosing try/while/catch blocks and fetchBatch()'s visibility.
  • Two timing-bound tests failed CI's random-order coverage run under load and now leave more room, without losing what they pin. One is the #194 test from 2.24.4, whose time bound was 1 s for a 300 ms request. The other is a #188 fetch test whose answer lands about 50 ms before its deadline.

The full record is in the CHANGELOG.