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

Worker process should also be waited #374

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dorinelfilip
Copy link

@dorinelfilip dorinelfilip commented Jul 6, 2024

❤️ Thank you for your contribution!

Description

Please describe briefly your pull request.

There are cases (such as the port being already in use or other fatal errors) when the server closes unexpectedly and the worker process is left running in the background with no easy option to catch it.

I changed the run command, such that it also waits for the worker. I have also add some red messages to point the die event of the server process.

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

There are cases (such as the port being already in use or other fatal errors) when the server closes unexpectedly and the worker process is left running in the background with no easy option to catch it.

I changed the run command, such that it also waits for the worker. I have also add some red messages to point the die event of the server process.
Copy link
Contributor

@fenekku fenekku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the delay for review, we were focused on v12 release at the time and some of us are only now finding some time to catch-up on community PRs.

Let us know if the change makes sense and we can get it in. I will only be back in January and will merge this in by then if no other movement on this.

Thanks for the contribution!

@@ -178,3 +179,7 @@ def signal_handler(sig, frame):

click.secho(f"Instance running!\nVisit https://{host}:{port}", fg="green")
server.wait()
click.secho("Server execution ended.", fg="red")
if services:
worker.wait()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be:

Suggested change
worker.wait()
worker.terminate()

instead? At this point, the worker process should be killed since the server has ended (we reached this code). The signal.SIGINT handling above would have addressed the interrupt case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To review
Development

Successfully merging this pull request may close these issues.

2 participants