getwayworker timer_worker退出无法自动清除timer问题

Please answer these questions before submitting your issue. Thanks!

What did you do? If possible, provide a simple script for reproducing the error.

在woker里面使用了tick

$this->server->on( 'WorkerStart', function( $serv, $worker_id ){

$serv->tick( 1000, function() use ( $serv ){

}

});

What did you expect to see?

退出程序的时候出现

INFO Server is shutdown now

然后一分多钟后才退出退出,会出现

WARNING swWorker_reactor_is_empty (ERRNO 9012): worker exit timeout, forced to terminate

移除tick之后不会出现

通过在tick函数里面增加清除timer的操作就可以解决

$serv->tick( 1000, function() use ( $serv ){

\Swoole\Timer::clearAll();

});

在worker stop之后,定时器还是继续在工作,并没有停止

这个问题之前提了两个issue了

https://github.com/swoole/swoole-src/issues/2686

https://github.com/swoole/swoole-src/issues/2697

What did you see instead?

What version of Swoole are you using (show your php --ri swoole)?

swoole

Swoole => enabled

Author => Swoole Team

Version => 4.4.4

Built => Aug 19 2019 10:19:55

coroutine => enabled

epoll => enabled

eventfd => enabled

signalfd => enabled

spinlock => enabled

rwlock => enabled

http2 => enabled

zlib => enabled

mutex_timedlock => enabled

pthread_barrier => 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 => On => On

swoole.unixsock_buffer_size => 8388608 => 8388608

What is your machine environment used (including version of kernel & php & gcc) ?

# php -v

PHP 7.3.8 (cli) (built: Aug 2 2019 06:05:30) ( NTS )

Copyright (c) 1997-2018 The PHP Group

Zend Engine v3.3.8, Copyright (c) 1998-2018 Zend Technologies

# uname -a

Linux 4aa839b14ac0 4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019 x86_64 Linux

# gcc --version

gcc (Alpine 8.3.0) 8.3.0

Copyright (C) 2018 Free Software Foundation, Inc.

This is free software; see the source for copying conditions. There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值