From 8890d0997ce6a2869442ea1f9274a1c501817d8a Mon Sep 17 00:00:00 2001 From: Chris Minett <1084019+chrisminett@users.noreply.github.com> Date: Fri, 12 Jul 2024 16:31:03 +0100 Subject: [PATCH] Add Pool connection retry delay for failed useTube command --- CHANGELOG.md | 2 ++ src/Pool/ManagedConnection.php | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 423d7de..e14c4d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ The backward compatibility promise has the following exceptions: * Units of code that are annotated with `@internal`. ## [Unreleased] +### Fixed +- Add a retry delay to a Pool connection when `useTube()` fails. ## [3.0.1] - 2023-10-14 ### Changed diff --git a/src/Pool/ManagedConnection.php b/src/Pool/ManagedConnection.php index 1599173..61e5d6c 100644 --- a/src/Pool/ManagedConnection.php +++ b/src/Pool/ManagedConnection.php @@ -54,7 +54,9 @@ public function disconnect(): bool public function useTube(string $tube): void { - $this->connection->useTube($tube); + $this->tryCommand( + fn() => $this->connection->useTube($tube) + ); } public function put(