-
Notifications
You must be signed in to change notification settings - Fork 2
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
Stopping spawned threads when the web session dies? #8
Comments
To give a little more context: I have a very interesting segfault in my Haskell program (!) which appears to be related to kansas-comet. I do the following:
Do you have any idea what this could be about? |
Someone will look at this in a bit. We want to get this working before releasing a paper about blank canvas. |
Hm, I'm having trouble reproducing this problem. What setup are you using? I'm using GHC(i) 7.8.4 on 64-bit Linux, and I've tried repeating steps 1-4 using the |
Sorry, I made some more progress on this. I found that the segfault was actually unrelated to kansas-comet. It was an issue where Scotty/Warp was failing to die completely when I did the Control-C, and it was holding on to an old, unsafe database handle. Step 4 would trigger an attempt to use the database handle and the segfault. So that's one mystery solved. It would still be really nice if kansas-comet could detect when clients are going away though. Otherwise I'm going to have to implement my own heartbeat mechanism. |
The purpose of kansas-comet is to provide a robust channel between a Haskell server, and a JavaScript client. It makes sense that the comet provide some sort of heatbeat to make the channel robust. We should perhaps revisit the user-facing API to see if this should be exposed somehow - we've not really thought about robustness. |
Yeah, the client API is a little tricky, especially given that the Here's a suggestion:
By catching this exception the user can do whatever cleanup they need, including killing child threads. (If they fail to catch the exception and their thread dies by default, so much the better.) |
Hey @andygill , friendly ping on this issue? |
No, we've not looked at it, but with the summer starting, we'll pull into into our summer projects. |
I've been noticing that the threads spawned via "connect" (whenever you visit a comet-enabled page) never get killed. Is it possible to somehow detect when the web page has been closed and cause the thread to die? Otherwise it seems like these threads will pile up forever. Thanks!
The text was updated successfully, but these errors were encountered: