Skip to content

v2.24.5

Choose a tag to compare

@bpacholek bpacholek released this 10 Oct 06:02
· 113 commits to main since this release

Patch release. The library now requires amphp/amp ^3.1.3, up from ^3.1 (#200). Under amp 3.1.0 to 3.1.2, a request with waitForReconnect: false lost a reply that came in the same read as a server's lame-duck INFO.

Upgrading is recommended for every application whose composer.lock holds amp 3.1.0 to 3.1.2. There are no API or code changes.

Fixed

  • A reply behind a lame-duck INFO is no longer lost under amp 3.1.0 to 3.1.2 (#200). Before amp 3.1.3, CompositeCancellation::isRequested() and throwIfRequested() reported a part that had fired only one event-loop tick later. With waitForReconnect: false, the read that meets a lame-duck INFO asks such a composite whether the request's wake-up has fired, that is, whether its reply came in the same chunk. Under 3.1.2 the answer was no. The request failed with Connection is not open, its reply delivered and dropped, every time the reply came behind the INFO (reconnect on, a cluster to fail over to). requestMany() and fetchBatch() returned what they had received, and a SubscriptionQueue poll kept its message for the next poll. amp 3.1.3 asks the composite's parts directly. CI always resolves the newest amp, so only applications and contributors locked on an older release met it.

Before upgrading

  • amp 3.1.3 is a patch release with the same requirements as 3.1.2 (php >=8.1, revolt/event-loop ^1 || ^0.2).
  • On a lock that holds amp 3.1.0 to 3.1.2, update with composer update, or with composer update idct/php-nats-jetstream-client --with-all-dependencies (-W). Without -W, updating this package alone keeps the locked amp, and Composer stays on 2.24.4 without an error.

Quality gates

  • PHPStan level 8.
  • 3214 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.00% over the 3798 mutants it ran (90% floor enforced in CI); it skipped 4783 of the 8581 it generated as too slow, so the score does not include them.
  • The two existing tests that pin the fix fail under amp 3.1.2 and pass under 3.1.3: OperationReadLameDuckFailoverTest::testWithWaitingDisabledAnOperationWhoseReadBringsTheLameDuckInfoFailsAtOnce and OperationReadReconnectLifecycleTest::testAnOperationParkedOnTheReconnectItStartedDoesNotSpin.

The full record is in the CHANGELOG.