Skip to content

reloading and latest files #1112

Description

@rbro

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions