You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "pjfanning (via GitHub)" <gi...@apache.org> on 2026/10/23 23:14:39 UTC
[PR] AMQP: Add regression test for cached connection reconnect [pekko-connectors]
pjfanning opened a new pull request, #2016:
URL: https://github.com/apache/pekko-connectors/pull/2016
### Motivation
[akka/alpakka#3023](https://github.com/akka/alpakka/issues/3023) reported that `AmqpCachedConnectionProvider` kept handing out a closed connection after the server forced it closed, because the underlying connection was held in a `lazy val`. Pekko Connectors already obtains a fresh connection on each `Empty -> Connecting` transition (`getRecursive`), but nothing tests that behaviour.
### Modification
Add the regression test from [akka/alpakka#3025](https://github.com/akka/alpakka/pull/3025), which is Apache licensed. It aborts the cached connection, releases it, and checks that the next `get` returns a new open connection. The new connection is also released at the end. Existing headers are unchanged.
### Result
A regression to caching the underlying connection would be caught.
### Tests
- `docker compose up -d amqp`
- `sbt "amqp/Test/testOnly org.apache.pekko.stream.connectors.amqp.scaladsl.AmqpConnectionProvidersSpec"`: 18 passed
- `sbt scalafmtAll`
- Not shown failing first: the production fix is already present in this repo
### References
Refs akka/alpakka#3023, akka/alpakka#3025
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org