You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you for the package.
It reloads the server as expected when any file in given paths changes.
However, the script is also causing failure in shutting down the Open Swoole server.
When the watcher is not enabled, Swoole server start and shutdown processes work as expected (called through commands).
However, when the watcher is in the place, it doesn't let the server go shutdown even if you have stopped the watcher.
I have created a very simple and ready to run script (given in the end) to observe the behavior.
Steps to produce
Save the code in a file named wss.php
Watcher start() and stop() events are commented out initially.
Edit the $cfg array as per your installation and save changes.
First test if the server is starting and shutting down as expected without the watcher
It would be great to give 1 or 2 seconds gap between running each command.
Run the command: php /home/wss.php start
Run the command: php /home/wss.php shutdown
Run the command: php /home/wss.php start
The server start, shutdown, and start processes would go smoothly.
Now enable the watcher and test the same.
Remove comments before line number 50 and 53.
Run the 3 commands in sequence, start, shutdown, start
On the second start, the terminal would throw error:
Uncaught Swoole\Exception: failed to listen server port[127.0.0.1:9000], Error: Address already in use[98] in /home/wss.php:30
Expected behavior
The server shutdown and further start processes should be succeed as expected.
Observed behavior
The server shutdown process halts and further start process complaints that the port is already in use.
Uncaught Swoole\Exception: failed to listen server port[127.0.0.1:9000], Error: Address already in use[98] in /home/wss.php:30
_Stack trace:
-0 /home/wss.php(30): Swoole\Server->__construct()
-1 /home/wss.php(79): Wss->_construct()
-2 {main}
thrown in /home/wss.php on line 30
First of all, thank you for the package.
It reloads the server as expected when any file in given paths changes.
However, the script is also causing failure in shutting down the Open Swoole server.
When the watcher is not enabled, Swoole server start and shutdown processes work as expected (called through commands).
However, when the watcher is in the place, it doesn't let the server go shutdown even if you have stopped the watcher.
I have created a very simple and ready to run script (given in the end) to observe the behavior.
Steps to produce
Save the code in a file named wss.php
Watcher
start()
andstop()
events are commented out initially.Edit the
$cfg
array as per your installation and save changes.First test if the server is starting and shutting down as expected without the watcher
It would be great to give 1 or 2 seconds gap between running each command.
Run the command:
php /home/wss.php start
Run the command:
php /home/wss.php shutdown
Run the command:
php /home/wss.php start
The server start, shutdown, and start processes would go smoothly.
Now enable the watcher and test the same.
Remove comments before line number 50 and 53.
Run the 3 commands in sequence, start, shutdown, start
On the second start, the terminal would throw error:
Uncaught Swoole\Exception: failed to listen server port[127.0.0.1:9000], Error: Address already in use[98] in /home/wss.php:30
Expected behavior
The server shutdown and further start processes should be succeed as expected.
Observed behavior
The server shutdown process halts and further start process complaints that the port is already in use.
Uncaught Swoole\Exception: failed to listen server port[127.0.0.1:9000], Error: Address already in use[98] in /home/wss.php:30
_Stack trace:
-0 /home/wss.php(30): Swoole\Server->__construct()
-1 /home/wss.php(79): Wss->_construct()
-2 {main}
thrown in /home/wss.php on line 30
Environment
OS: CentOS 8 Stream
PHP version: 8.1
Open Swoole version: 4.11.1
Ready script
The text was updated successfully, but these errors were encountered: