Skip to content

Commit 8c39b84

Browse files
committed
Merge branch 'development'
2 parents 5483726 + 9ddf436 commit 8c39b84

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a CHANGELOG](http://keepachangelog.com).
55

6+
## [2.7.1] - 2019-04-29
7+
8+
### Fixed
9+
10+
* Remove failed sockets from internal collection that errored out during reading of response in order to prevent infinite
11+
tries/re-use of those failed connections. - [#37]
12+
613
## [2.7.0] - 2019-04-28
714

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

196+
[2.7.1]: https://github.com/hollodotme/fast-cgi-client/compare/v2.7.0...v2.7.1
189197
[2.7.0]: https://github.com/hollodotme/fast-cgi-client/compare/v2.6.0...v2.7.0
190198
[2.6.0]: https://github.com/hollodotme/fast-cgi-client/compare/v2.5.0...v2.6.0
191199
[2.5.0]: https://github.com/hollodotme/fast-cgi-client/compare/v2.4.3...v2.5.0
@@ -212,3 +220,4 @@ Based on [Pierrick Charron](https://github.com/adoy)'s [PHP-FastCGI-Client](http
212220
[#26]: https://github.com/hollodotme/fast-cgi-client/issues/26
213221
[#27]: https://github.com/hollodotme/fast-cgi-client/issues/27
214222
[#33]: https://github.com/hollodotme/fast-cgi-client/pull/33
223+
[#37]: https://github.com/hollodotme/fast-cgi-client/issue/37

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This is the documentation of the latest release.
1717
Please see the following links for earlier releases:
1818

1919
* 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]
20-
* 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]
20+
* 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]
2121

2222
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).
2323

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

765765

766+
[v2.7.0]: https://github.com/hollodotme/fast-cgi-client/blob/v2.7.0/README.md
767+
[v2.6.0]: https://github.com/hollodotme/fast-cgi-client/blob/v2.6.0/README.md
766768
[v2.5.0]: https://github.com/hollodotme/fast-cgi-client/blob/v2.5.0/README.md
767769
[v2.4.3]: https://github.com/hollodotme/fast-cgi-client/blob/v2.4.3/README.md
768770
[v2.4.2]: https://github.com/hollodotme/fast-cgi-client/blob/v2.4.2/README.md

src/Client.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,16 @@ public function sendAsyncRequest( ProvidesRequestData $request ) : int
125125
*/
126126
public function readResponse( int $requestId, ?int $timeoutMs = null ) : ProvidesResponseData
127127
{
128-
return $this->sockets->getById( $requestId )->fetchResponse( $timeoutMs );
128+
try
129+
{
130+
return $this->sockets->getById( $requestId )->fetchResponse( $timeoutMs );
131+
}
132+
catch ( Throwable $e )
133+
{
134+
$this->sockets->remove( $requestId );
135+
136+
throw $e;
137+
}
129138
}
130139

131140
/**
@@ -184,6 +193,8 @@ private function fetchResponseAndNotifyCallback( Socket $socket, ?int $timeoutMs
184193
}
185194
catch ( Throwable $e )
186195
{
196+
$this->sockets->remove( $socket->getId() );
197+
187198
$socket->notifyFailureCallbacks( $e );
188199
}
189200
}
@@ -254,6 +265,7 @@ public function readResponses( ?int $timeoutMs = null, int ...$requestIds ) : Ge
254265
}
255266
catch ( Throwable $e )
256267
{
268+
$this->sockets->remove( $requestId );
257269
}
258270
}
259271
}

0 commit comments

Comments
 (0)