Skip to content

Commit

Permalink
Merge pull request #568 from sakuraovq/master
Browse files Browse the repository at this point in the history
igr close connection error
  • Loading branch information
sakuraovq authored Apr 12, 2020
2 parents 52cf587 + 0b3b7bd commit 7aac80d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/connection-pool/src/AbstractPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,12 @@ public function close(): int
continue;
}

$connection->close();
try {
// May be disconnected
$connection->close();
} catch (Throwable $e) {
CLog::warning('Pool close connection error ' . $e->getMessage());
}
}

return $this->count;
Expand Down Expand Up @@ -275,8 +280,12 @@ private function popByChannel(): ?ConnectionInterface
// Out of `maxIdleTime`
if ($time - $lastTime > $this->maxIdleTime) {

// Fix expired connection not released
$connection->close();
try {
// Fix expired connection not released, May be disconnected
$connection->close();
} catch (Throwable $e) {
CLog::warning('popByChannel close connection error ' . $e->getMessage());
}

$this->count--;
continue;
Expand Down

0 comments on commit 7aac80d

Please sign in to comment.