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

kill signal for server process in loop #31

Open
peterbecich opened this issue Mar 11, 2024 · 4 comments
Open

kill signal for server process in loop #31

peterbecich opened this issue Mar 11, 2024 · 4 comments

Comments

@peterbecich
Copy link

Thanks for this great program.

I have a feedback.yaml, and have defined a loop: https://github.com/peterbecich/halogen-chess/blob/8ec3f53991e529b44b5bfd78889e0fa91f4b6a93/feedback.yaml#L15

It runs a program halogen-chess which binds to port 8080.

The loop runs once successfully.
When the loop restarts, I see an error:

halogen-chess: Network.Socket.bind: resource busy (Address already in use)

The issue is solved by exiting feedback, which kills the halogen-chess process bound to port 8080.

Could feedback send a different kill signal to the process, when the loop is repeated, to solve this issue?

An alternative solution may be a before-all hook, such as:

    hooks:
      before-all:
        kill -9 $(lsof -t -i:8080 -sTCP:LISTEN);
@peterbecich peterbecich changed the title Is kill signal used correctly? kill signal for server process in loop Mar 11, 2024
@NorfairKing
Copy link
Owner

@peterbecich Feedback was never really intended for long-running processes in the loop, but now I see that that's actually a really cool use-case.

I think your before-all hook would not really solve the issue at hand.

Feedback "just" needs to wait for the process to exit correctly, but I'm surprised that it doesn't because I thought I had implemented that :(

Any digging would be welcome because I'm currently at an airport.

@NorfairKing
Copy link
Owner

@peterbecich any news?

@peterbecich
Copy link
Author

@NorfairKing , no, sorry, I've been unable to put any time into this issue

@NorfairKing
Copy link
Owner

@peterbecich have you tried with latest master? It might be fixed now. I added some smartness about killing the loop process.

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

No branches or pull requests

2 participants