-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Workerman is great. I'm running into 2 issues with reloading that may be the same issue that I was hoping you could assist with:
I have a script similar to the example for "The following code will be automatically updated after reload" on https://manual.workerman.net/doc/en/faq/reload-principle.html.
This scenario is working as expected:
- in terminal 1, run "start"
- in terminal 2, run "curl http://127.0.0.1:2345" and get the expected output.
- edit MessageHandler.php to change the output
- in terminal 2, run "reload -g"
- in terminal 2, run "curl http://127.0.0.1:2345". I get the new output as expected.
Now instead I tried the below:
- in terminal 1, run "start"
- in Firefox or Chrome, go to http://127.0.0.1:2345 and get the expected output.
- in terminal 2, run "curl http://127.0.0.1:2345" and get the expected output.
- edit MessageHandler.php to change the output
- in terminal 2, run "reload -g"
At this point, I'm seeing 2 possible issues:
Issue 1) If I run "curl http://127.0.0.1:2345", sometimes I get the new output and sometimes I get the old output.
Issue 2) If I go to http://127.0.0.1:2345 in Firefox or Chrome, I don't get the new output.
The only way I've been able to resolve it is by closing Firefox or Chrome. Then both scenarios work as expected.
My questions are:
- For issue 1, is Workerman routing the request to the old process even though it should be shutting down?
- For issue 2, my guess is because the web browser is holding onto the connection in some form? Is there a way to prevent it?
Thank you for your help.