Real-time notification stops working
I've deployed a talkyard for my community but after a few seconds the real-time notification stops working and I need to refresh the page.
I've check the logs and I have a "client prematurely closed connection while sending to client" right along the time the browser stops receiving it.
I tried to check from where it might be coming but due to my lack of full understanding of the Talkyard, and where to look, I can't.
Could you help me?
- 8 replies
- KajMagnus @KajMagnus2018-06-29 12:15:58.053Z
Hello Tiago! Thanks for including the error log message, i.e.
"client prematurely ...". Apparently it's from Nchan, the Nginx module that's being used for real time notifications. I'll look into this now & during the weekend ... I think this problem happens to me too sometimes.
(Interesting that you tried to check from where the message comes — what's your background if I may ask? You do softw dev sometimes?)
Actually yes, sometimes. I am doing my Master in Machine Learning and Deep Learning.
I thought about nchan but given the fact I'm still trying to understand how everything works together ahah.
- KajMagnus @KajMagnus2018-06-30 06:22:59.541Z
Ok :- ) that sounds interesting. I did juts a little bit neural networks long ago b.t.w. ... before Deep Learning happened.
I've fixed the bug now (or so I think), and works when I test on localhost. I'll release a new version in a few days and then live notifications should work again.
(The reason for the bug, is that long ago I changed from
Bliss.fetch, and didn't notice that after that,
theRequest.abort()no longer invoked [an error callback in which next long polling request got sent]. ... So, after the first long polling request, no more long polling requests got sent :- P )
Oh nice! It's amazing if we compare the uses it had before and how the architectures evolved and got ultra complex. You get a bit "how the hell does this work?" ahah
Oh So it was on the client side. I would have spent a few days on that one (I was still reading and understanding nchan ahaha).
Thank you very much :D
- KajMagnus @KajMagnus2018-07-20 15:25:31.319Z
(Sorry for the late reply.) Seems as if the above-mentioned fix wasn't the only problem. Live notifications now work when I test on localhost, but when the server has been up and running for a while, apparently they stop wroking. My best guess right now is that there's a bug in Nchan, and the Nchan author have been coding a lot lately and fixed bugs, and says he'll release a new version soon, like, in a week. So I'll upgrade to that new version and see if live notfs start working properly then.
- In reply toTiago⬆:KajMagnus @KajMagnus2018-08-02 13:34:47.606Z
@Tiago Turns out there's another problem too: there's a segfault (C code crash) in an Nginx worker thread, from inside a Lua module. When the worker thread suddenly exits, Nchan's internal state gets messed up, and notifications stop working. I posted about this yesterday over at GitHub, the Lua module repo. https://github.com/openresty/lua-nginx-module/issues/1361
- @KajMagnus marked this topic as Planned 2018-08-05 11:36:54.087Z.
- @KajMagnus marked this topic as Started 2018-08-05 11:36:56.353Z.