varabyte/kobweb

Server occasionally won't shut down?

Closed this issue · 4 comments

Not sure what's going on, but when you press Q to quit in the console, occasionally it just waits forever. You have to kill the process manually and CTRL-C kobweb. This is a horrible experience.

It's possible it has something to do with a server freaking out after a bunch of live reloads. I mean, maybe it's just a guess, but I should look into my /api/kobweb-status event stream logic in Routing.kt, but no guarantees it isn't some other issue.

It's probably easy to fix if I can find a way to regularly reproduce but I don't have any steps at the moment.

server-death.txt

Caught some output on a dying server

I'm a bit concerned that there's nowhere that my code is showing up in the callstacks, but it seems maybe like I'm killing a coroutine at a bad time?

Frustratingly, it seems like this is still happening. However, what's weird is if I listen to the process's output, it "unblocks" the hang.

In other words, if the server is running with PID=12345, then sudo cat /proc/12345/fd/1 unblocks it.... I'll have to research why this might happen.

This seems to be better so far with 0.9.2 🤞

Keeping an eye on it. If I don't have issues with the server shutting down by the time 0.9.3 goes out, I'll close this issue.

I am overjoyed (and hopefully not premature) in saying that I haven't seen this all week. So I'm going to close this bug - things should work as long as you depend on kobweb v0.9.2 or later in your codebase