Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
hollodotme committed Apr 29, 2019
2 parents 5483726 + 9ddf436 commit 8c39b84
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a CHANGELOG](http://keepachangelog.com).

## [2.7.1] - 2019-04-29

### Fixed

* Remove failed sockets from internal collection that errored out during reading of response in order to prevent infinite
tries/re-use of those failed connections. - [#37]

## [2.7.0] - 2019-04-28

### Added
Expand Down Expand Up @@ -186,6 +193,7 @@ Based on [Pierrick Charron](https://github.com/adoy)'s [PHP-FastCGI-Client](http
* Getters/Setters for connect timeout, read/write timeout, keep alive, socket persistence from `Client` (now part of the socket connection)
* Method `Client->getValues()`

[2.7.1]: https://github.com/hollodotme/fast-cgi-client/compare/v2.7.0...v2.7.1
[2.7.0]: https://github.com/hollodotme/fast-cgi-client/compare/v2.6.0...v2.7.0
[2.6.0]: https://github.com/hollodotme/fast-cgi-client/compare/v2.5.0...v2.6.0
[2.5.0]: https://github.com/hollodotme/fast-cgi-client/compare/v2.4.3...v2.5.0
Expand All @@ -212,3 +220,4 @@ Based on [Pierrick Charron](https://github.com/adoy)'s [PHP-FastCGI-Client](http
[#26]: https://github.com/hollodotme/fast-cgi-client/issues/26
[#27]: https://github.com/hollodotme/fast-cgi-client/issues/27
[#33]: https://github.com/hollodotme/fast-cgi-client/pull/33
[#37]: https://github.com/hollodotme/fast-cgi-client/issue/37
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This is the documentation of the latest release.
Please see the following links for earlier releases:

* PHP >= 7.0 (EOL) [v1.0.0], [v1.0.1], [v1.1.0], [v1.2.0], [v1.3.0], [v1.4.0], [v1.4.1], [v1.4.2]
* PHP >= 7.1 [v2.0.0], [v2.0.1], [v2.1.0], [v2.2.0], [v2.3.0], [v2.4.0], [v2.4.1], [v2.4.2], [v2.4.3], [v2.5.0]
* PHP >= 7.1 [v2.0.0], [v2.0.1], [v2.1.0], [v2.2.0], [v2.3.0], [v2.4.0], [v2.4.1], [v2.4.2], [v2.4.3], [v2.5.0], [v2.6.0], [v2.7.0]

Read more about the journey to and changes in `v2.6.0` in [this blog post](https://hollo.me/php/background-info-fast-cgi-client-v2.6.0.html).

Expand Down Expand Up @@ -763,6 +763,8 @@ Run a call through a Unix Domain Socket
This shows the response of the php-fpm status page.


[v2.7.0]: https://github.com/hollodotme/fast-cgi-client/blob/v2.7.0/README.md
[v2.6.0]: https://github.com/hollodotme/fast-cgi-client/blob/v2.6.0/README.md
[v2.5.0]: https://github.com/hollodotme/fast-cgi-client/blob/v2.5.0/README.md
[v2.4.3]: https://github.com/hollodotme/fast-cgi-client/blob/v2.4.3/README.md
[v2.4.2]: https://github.com/hollodotme/fast-cgi-client/blob/v2.4.2/README.md
Expand Down
14 changes: 13 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,16 @@ public function sendAsyncRequest( ProvidesRequestData $request ) : int
*/
public function readResponse( int $requestId, ?int $timeoutMs = null ) : ProvidesResponseData
{
return $this->sockets->getById( $requestId )->fetchResponse( $timeoutMs );
try
{
return $this->sockets->getById( $requestId )->fetchResponse( $timeoutMs );
}
catch ( Throwable $e )
{
$this->sockets->remove( $requestId );

throw $e;
}
}

/**
Expand Down Expand Up @@ -184,6 +193,8 @@ private function fetchResponseAndNotifyCallback( Socket $socket, ?int $timeoutMs
}
catch ( Throwable $e )
{
$this->sockets->remove( $socket->getId() );

$socket->notifyFailureCallbacks( $e );
}
}
Expand Down Expand Up @@ -254,6 +265,7 @@ public function readResponses( ?int $timeoutMs = null, int ...$requestIds ) : Ge
}
catch ( Throwable $e )
{
$this->sockets->remove( $requestId );
}
}
}
Expand Down

0 comments on commit 8c39b84

Please sign in to comment.