varabyte / kobweb

A modern framework for full stack web apps in Kotlin, built upon Compose HTML
https://kobweb.varabyte.com
Apache License 2.0
1.46k stars 65 forks source link

Server occasionally won't shut down? #89

Closed bitspittle closed 2 years ago

bitspittle commented 2 years ago

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.

bitspittle commented 2 years ago

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?

bitspittle commented 2 years ago

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.

bitspittle commented 2 years ago

This seems to be better so far with 0.9.2 :crossed_fingers:

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.

bitspittle commented 2 years ago

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