swoole / swoole-src

🚀 Coroutine-based concurrency library for PHP
https://www.swoole.com
Apache License 2.0
18.25k stars 3.16k forks source link

Detect additional error message "Broken Pipe" as Lost Connection #5280

Closed kingIZZZY closed 1 month ago

kingIZZZY commented 1 month ago

Example fatal error trying to use database connection from PDOPool after a long time of not using them

Fatal error: Uncaught ErrorException: PDOStatement::execute(): Send of 2109 bytes failed with errno=32 Broken pipe in @swoole/library/core/Database/PDOStatementProxy.php:53
Stack trace:
#0 [internal function]: Hyperf\ExceptionHandler\Listener\ErrorExceptionHandler::Hyperf\ExceptionHandler\Listener\{closure}(8, 'PDOStatement::e...', '@swoole/library...', 53)
#1 @swoole/library/core/Database/PDOStatementProxy.php(53): PDOStatement->execute(Array)
#2 /home/dev/project/app/Tasks/SomethingTask.php(1921): Swoole\Database\PDOStatementProxy->__call('execute', Array)
#3 [internal function]: App\Tasks\SomethingTask::batch('1', NULL, Array, 93, false)
#4 {main}
  thrown in @swoole/library/core/Database/PDOStatementProxy.php on line 53

Candidate strings

See also

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 71.56%. Comparing base (9f1c48a) to head (b8b3330).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #5280 +/- ## ========================================== + Coverage 71.54% 71.56% +0.01% ========================================== Files 105 105 Lines 16084 16084 Branches 2973 2972 -1 ========================================== + Hits 11507 11510 +3 + Misses 4522 4519 -3 Partials 55 55 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.