Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pool error is Swoft\Connection\Pool\AbstractPool::popByChannel(): Send of 5 bytes failed with errno=110 Operation timed out file=/var/www/vendor/swoft/connection-pool/src/AbstractPool.php line=289. (At /var/www/vendor/swoft/db/src/DB.php line 81) #1465

Open
stevenscl opened this issue Feb 9, 2022 · 4 comments
Assignees
Labels
swoft: db Issues for swoft db component

Comments

@stevenscl
Copy link

Q A
Bug report? yes
Feature request? no
Swoft version 2.0.11
Swoole version 4.8.6
PHP version 7.4.27
Runtime environment Docker etc

Describe the bug
数据库连接池popByChannel() Send of 5 bytes failed with errno=110 Operation timed out,导致请求失败

Expected behavior
应用启动一段时间过后,通常12小时以上,当再次发起请求,会出现如上报错

Screenshots
image

Details

Describe what you are trying to achieve and what goes wrong.

// paste output here

Provide minimal script to reproduce the issue

// paste code
@github-actions github-actions bot added the swoft: db Issues for swoft db component label Feb 9, 2022
@stevenscl
Copy link
Author

Dockerfile

FROM phpswoole/swoole:4.8-php7.4-alpine RUN set -ex \ && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/' /etc/apk/repositories \ && apk update \ && apk add --no-cache --virtual .build-deps ca-certificates curl tar xz libressl libstdc++ openssl openssl-dev tzdata pcre autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c pcre-dev zlib-dev libpng-dev freetype-dev libjpeg-turbo-dev icu-dev libzip-dev mosquitto-dev \ && pecl update-channels \ && pecl install redis-stable \ && pecl install mongodb-stable \ && pecl install Mosquitto-alpha \ && docker-php-ext-enable redis mongodb mosquitto \ && docker-php-ext-install pdo_mysql bcmath gd sysvshm sysvmsg sysvsem zip intl

@stevenscl
Copy link
Author

数据库连接池配置
image

@stevenscl
Copy link
Author

测试发现,minActive = 5,则前面连续5次请求均失败,第6次恢复正常

@laishaolin
Copy link

这个问题已经很久了官方都没有解决,只能自己在定时器上写个查询,不停的给DB发查询请求来保活;我现在改了连接池的底层实现,但偶尔还会来一个上面那样的请求错误。
这样的更新维护效率swoft终究是要被淘汰的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
swoft: db Issues for swoft db component
Projects
None yet
Development

No branches or pull requests

3 participants