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

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

Closed
CXW0504 opened this issue Nov 29, 2021 · 7 comments
Closed

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

CXW0504 opened this issue Nov 29, 2021 · 7 comments
Labels
question Further information is requested

Comments

@CXW0504
Copy link

CXW0504 commented Nov 29, 2021

  • 你遇到了什么问题?
    vendor/longlang/phpkafka/src/Client/SwooleClient.php(135): longlang\phpkafka\Socket\SwooleSocket->recv()
    IDEA 无法自动提示 #1 {main}
    thrown in /opt/code/novel/vendor/longlang/phpkafka/src/Socket/SwooleSocket.php on line 128
    PHP Fatal error: Uncaught longlang\phpkafka\Exception\SocketException: Could not recv data from stream,

  • Kafka 环境是自建还是云服务?

docker自建

  • 请执行下面的命令获取环境信息。

php -v & php --ri swoole & composer info | grep longlang/phpkafka

# 粘贴到这里

 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
Copy link
Member

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

@Yurunsoft Yurunsoft added the question Further information is requested label Nov 29, 2021
@zhiyuanchen1991
Copy link

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

@zhiyuanchen1991
Copy link

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

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

@Yurunsoft
Copy link
Member

已发 v1.2.1

@chunhei2008
Copy link

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

@chunhei2008
Copy link

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

@a289459798
Copy link

遇到同样的问题^1.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants