feedback icon indicating copy to clipboard operation
feedback copied to clipboard

kill signal for server process in `loop`

Open peterbecich opened this issue 1 year ago • 4 comments

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 avatar Mar 11 '24 03:03 peterbecich

@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 avatar Mar 11 '24 12:03 NorfairKing

@peterbecich any news?

NorfairKing avatar Apr 02 '24 12:04 NorfairKing

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

peterbecich avatar Jun 02 '24 03:06 peterbecich

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

NorfairKing avatar Jun 02 '24 03:06 NorfairKing