walkor / walkor/workerman

reloading and latest files

Open
#1,112 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
11.6k
Forks
2.2k
Avg merge
11h 30m
Merged PRs (30d)
3

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:
1) in terminal 1, run "start"
2) in terminal 2, run "curl http://127.0.0.1:2345" and get the expected output.
3) edit MessageHandler.php to change the output
4) in terminal 2, run "reload -g"
5) in terminal 2, run "curl http://127.0.0.1:2345". I get the new output as expected.

Now instead I tried the below:
1) in terminal 1, run "start"
2) in Firefox or Chrome, go to http://127.0.0.1:2345 and get the expected output.
3) in terminal 2, run "curl http://127.0.0.1:2345" and get the expected output.
4) edit MessageHandler.php to change the output
5) 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:
1) For issue 1, is Workerman routing the request to the old process even though it should be shutting down?
2) 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.