{"action":"opened","issue":{"url":"https://api.github.com/repos/swoole/swoole-src/issues/2968","repository_url":"https://api.github.com/repos/swoole/swoole-src","labels_url":"https://api.github.com/repos/swoole/swoole-src/issues/2968/labels{/name}","comments_url":"https://api.github.com/repos/swoole/swoole-src/issues/2968/comments","events_url":"https://api.github.com/repos/swoole/swoole-src/issues/2968/events","html_url":"https://github.com/swoole/swoole-src/issues/2968","id":526565499,"node_id":"MDU6SXNzdWU1MjY1NjU0OTk=","number":2968,"title":"onWorkerStart中创建的定时器，在reload后不执行","user":{"login":"eslizn","id":1698398,"node_id":"MDQ6VXNlcjE2OTgzOTg=","avatar_url":"https://avatars2.githubusercontent.com/u/1698398?v=4","gravatar_id":"","url":"https://api.github.com/users/eslizn","html_url":"https://github.com/eslizn","followers_url":"https://api.github.com/users/eslizn/followers","following_url":"https://api.github.com/users/eslizn/following{/other_user}","gists_url":"https://api.github.com/users/eslizn/gists{/gist_id}","starred_url":"https://api.github.com/users/eslizn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eslizn/subscriptions","organizations_url":"https://api.github.com/users/eslizn/orgs","repos_url":"https://api.github.com/users/eslizn/repos","events_url":"https://api.github.com/users/eslizn/events{/privacy}","received_events_url":"https://api.github.com/users/eslizn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-11-21T12:31:38Z","updated_at":"2019-11-21T12:31:38Z","closed_at":null,"author_association":"NONE","body":"Please answer these questions before submitting your issue. Thanks!\r\n\r\n1. What did you do? If possible, provide a simple script for reproducing the error.\r\n\r\n在worker中创建定时器，无论是否在onWorkerExit中清理\r\n```php\r\n\tpublic function onWorkerStart($srv, $id)\r\n\t{\r\n\t\tif (!$this->taskworker) {\r\n\t\t\t$this->timer = $this->tick(1000, function () use ($srv, $id) {\r\n\t\t\t\techo __METHOD__, \"\\n\";\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tpublic function onWorkerExit($srv, $id)\r\n\t{\r\n\t\tif ($this->timer) {\r\n\t\t\t$this->clearTimer($this->timer);\r\n\t\t\t$this->timer = null;\r\n\t\t}\r\n\t}\r\n```\r\n\r\n2. What did you expect to see?\r\n\r\n```\r\n每次workerStart创建的定时器正常工作\r\n```\r\n\r\n3. What did you see instead?\r\n\r\nreload之后定时器无法工作\r\n\r\n4. What version of Swoole are you using (show your `php --ri swoole`)?\r\n\r\n```\r\n\r\nswoole\r\n\r\nSwoole => enabled\r\nAuthor => Swoole Team <team@swoole.com>\r\nVersion => 4.2.13\r\nBuilt => Nov 20 2019 10:20:58\r\ncoroutine => enabled\r\nepoll => enabled\r\neventfd => enabled\r\nsignalfd => enabled\r\ncpu_affinity => enabled\r\nspinlock => enabled\r\nrwlock => enabled\r\nopenssl => OpenSSL 1.0.1e-fips 11 Feb 2013\r\npcre => enabled\r\nzlib => enabled\r\nmutex_timedlock => enabled\r\npthread_barrier => enabled\r\nfutex => enabled\r\nasync_redis => enabled\r\n\r\nDirective => Local Value => Master Value\r\nswoole.enable_coroutine => On => On\r\nswoole.display_errors => On => On\r\nswoole.use_shortname => On => On\r\nswoole.fast_serialize => Off => Off\r\nswoole.unixsock_buffer_size => 8388608 => 8388608\r\n```\r\n\r\n5. What is your machine environment used (including version of kernel & php & gcc) ?\r\n\r\n```\r\nPHP 7.1.9 (cli) (built: Aug 24 2018 16:49:04) ( NTS )\r\nCopyright (c) 1997-2017 The PHP Group\r\nZend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies\r\n```\r\n\r\n```\r\nlinux kernel: 3.10.106\r\n```\r\n\r\n```\r\ngcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)\r\nCopyright (C) 2015 Free Software Foundation, Inc.\r\nThis is free software; see the source for copying conditions.  There is NO\r\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\r\n```\r\n"}}
{"actor":{"display_login":"eslizn"}}