Coder Social home page Coder Social logo

Comments (4)

Rambatino avatar Rambatino commented on June 11, 2024

Command: PORT=3000 CompileDaemon -command="go run main.go"

Both graceful and not result in the same output.

from compiledaemon.

githubnemo avatar githubnemo commented on June 11, 2024

If I had to venture a guess then it is probably due to the socket not being closed fast enough (still waiting for an ACK from some connection, for example) and is still in CLOSE_WAIT state. You can verify this by running netstat -ton | grep CLOSE_WAIT in parallel.

There is no real fix for this other than terminating the connections beforehand (or not keeping them open at first) or to wait some time before the command the next time (in a pickle you could create a shell script that runs sleep 1 && go run main.go, for example).

from compiledaemon.

Rambatino avatar Rambatino commented on June 11, 2024

So I've found the reason, it's because it's not actually killing the child processes.

Even if I do the second thing in a bash script, it doesn't kill the server pid it kills the parent process pid. See: https://stackoverflow.com/questions/24982845/process-kill-on-child-processes

When I re-execute the binary it works and kills and restarts it properly (although the code obviously doesn't change).

I would argue that this library should kill the child processes too.

from compiledaemon.

Rambatino avatar Rambatino commented on June 11, 2024

ahh my bad there's a build command, so that does work! Thanks!

from compiledaemon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.