swoole / phpkafka

PHP Kafka client is used in PHP-FPM and Swoole. PHP Kafka client supports 50 APIs, which might be one that supports the most message types ever.
https://longlang.org/
Apache License 2.0
271 stars 47 forks source link

消费者过段时间就报错 #60

Closed CXW0504 closed 2 years ago

CXW0504 commented 3 years ago

docker自建

# 粘贴到这里

 php -v & php --ri swoole & composer info | grep longlang/phpkafka
[1] 8319
[2] 8320
PHP 7.4.24 (cli) (built: Oct  7 2021 05:44:58) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

swoole

Swoole => enabled
Author => Swoole Team <team@swoole.com>
Version => 4.7.1
Built => Oct  7 2021 05:50:26
coroutine => enabled with boost asm context
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
sockets => enabled
openssl => OpenSSL 1.1.1  11 Sep 2018
dtls => enabled
http2 => enabled
json => enabled
curl-native => enabled
pcre => enabled
zlib => 1.2.11
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
mysqlnd => enabled
async_redis => enabled

Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => Off => Off
swoole.unixsock_buffer_size => 8388608 => 8388608
longlang/phpkafka                  v1.2.0    A kafka client. Support php-fpm and Swoole.
[1]-  Done                    php -v
[2]+  Done                    php --ri swoole

* 提供最小可复现代码:

```php
// 你的代码
Yurunsoft commented 3 years ago

可以试试 dev-master 版本,支持断线重连,期待你的反馈

zhiyuanchen1991 commented 2 years ago

我之前也出现了这个错误,用最新的master分支的SwooleSocket.php代码替换后,就没再出现这样的问题了。

zhiyuanchen1991 commented 2 years ago

可以试试 dev-master 版本,支持断线重连,期待你的反馈

你好,经过三天的测试,我这里没有再出现这个问题。但是不能手动修改vendor包,可以发一个新的修订版本v1.2.1么?

Yurunsoft commented 2 years ago

已发 v1.2.1

chunhei2008 commented 2 years ago

这个问题1.2.1 继续存在 有可能的原因是: https://kafka.apache.org/documentation/#consumerconfigs_connections.max.idle.ms 导致的

chunhei2008 commented 2 years ago

我尝试创建一个 producer 定时的往 topic 发消息,这个问题好像会减轻。

a289459798 commented 1 year ago

遇到同样的问题^1.2.1