Fail pending deferred if pool closed

This commit is contained in:
Aaron Piotrowski 2018-09-26 12:27:31 -05:00
parent 480e90cba8
commit 79e9b849ad
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB

View File

@ -197,8 +197,13 @@ abstract class AbstractPool implements Pool
$connection->close();
}
$this->idle = new \SplQueue;
$this->connections = new \SplObjectStorage;
$this->prepare = null;
if ($this->deferred instanceof Deferred) {
$deferred = $this->deferred;
$this->deferred = null;
$deferred->fail(new FailureException("Connection pool closed"));
}
}
/**