Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

with --reload produce a zombie process problem #2990

Closed
1 task done
zybxjx opened this issue Jul 26, 2024 · 3 comments
Closed
1 task done

with --reload produce a zombie process problem #2990

zybxjx opened this issue Jul 26, 2024 · 3 comments
Labels

Comments

@zybxjx
Copy link

zybxjx commented Jul 26, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

With "start _ method = spell" and "- -reload" modify the code will produce a zombie process, modify the process.py-> _ terminate _ now() function, add self._current_process.join() after self._current_process.terminate() will not produce a zombie process, so ok?

Code snippet

from sanic import Sanic
from sanic.response import text

app = Sanic("MyHelloWorldApp")

@app.get("/")
async def hello_world(request):
# print('t')
return text("Hello, world.")

Expected Behavior

produce a zombie process

How do you run Sanic?

Sanic CLI

Operating System

Linux

Sanic Version

V24.6.0

Additional context

def _terminate_now(self):
    if not self._current_process.is_alive():
        return
    logger.debug(
        f"{Colors.BLUE}Begin restart termination: "
        f"{Colors.BOLD}{Colors.SANIC}"
        f"%s {Colors.BLUE}[%s]{Colors.END}",
        self.name,
        self._current_process.pid,
    )
    self._current_process.terminate()
    self._current_process.join() #new code
@zybxjx zybxjx added the bug label Jul 26, 2024
@ahopkins
Copy link
Member

I am not sure what is being asked here? Can you please clarify?

@zybxjx
Copy link
Author

zybxjx commented Dec 27, 2024

Start With " Sanic.start_method = 'spawk' " and "- -reload", modify the code will produce a zombie process.

@ahopkins
Copy link
Member

Spawn is the default. I'm closing this for now because it is not clear at all how to reproduce. Feel free to elaborate and we can reopen.

@ahopkins ahopkins closed this as not planned Won't fix, can't repro, duplicate, stale Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants