Skip to content

v2.26.4

Choose a tag to compare

@bpacholek bpacholek released this 13 Oct 11:55
· 56 commits to main since this release

Patch release.

What's fixed (#203). An operation that a DiscoveredServers or LameDuck listener starts and does not await now waits for the lame-duck failover and runs on the new server. This holds whichever read brought the lame-duck INFO. Before, the outcome depended on that read:

  • Your own read brought it. The failover ran inline in the listener's fiber, so every operation called from that fiber was taken for one issued inside the recovery. A request(), a processIncoming(), connect() or drain() failed at once with Connection is not open.
  • An operation's read brought it. The failover ran in a fiber of its own, and a processIncoming() the listener started read the leaving socket first. The client's own close of that socket was then reported as Socket closed by peer (EOF).

Who should upgrade: anyone whose LameDuck or DiscoveredServers listener starts operations without awaiting them. There are no API changes.

What changes

  • Inside or outside a reconnect. Whether an operation was issued inside a reconnect is now decided when it is called. Operations called from a connection or error listener while a reconnect is in flight are still refused at once (#145). An operation issued before the reconnect waits for it within its own timeout.
  • Reads during a failover. A read made while a failover running in its own fiber is leaving the connection now waits for that failover, within its cancellation, and returns 0 without reading. It does not wait for the Reconnected listener. With waitForReconnect: false it is refused at once.
  • Unchanged: timeouts, cancellations, event order and exception messages. The failover still starts only after these listeners return, so an operation a listener awaits still runs on the leaving server.
  • A listener constraint, now documented: a listener inside a reconnect must not await a future kept from before that reconnect if the future's operation waits for the same reconnect.

Quality gates

  • PHPStan level 8.
  • 3572 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/patch 100%: every changed line is covered. Total coverage 99.04%.
  • Infection covered MSI 92.84% (90% floor enforced in CI). It skipped 4981 of the 8824 mutants it generated as too slow, so the score does not include them. No mutant escaped in the changed lines.
  • New ListenerOperationFailoverTest, 53 cases, 37 of which fail on 2.26.3.
  • Eight broken variants of the fix were tried. Six each fail at least one case. The other two cover conditions no scenario could reach: the read gate's close-intent bypass, and its operation wake-up. Both are kept as defensive code.

The full record is in the CHANGELOG.