Replies: 1 comment 2 replies
-
@manson indeed it can be because of SSE, tell me how websockets go |
Beta Was this translation helpful? Give feedback.
-
@manson indeed it can be because of SSE, tell me how websockets go |
Beta Was this translation helpful? Give feedback.
-
@kamalshkeir
Hi! It's been a time I've been working on my project. So far so good, I haven't used all of the features of Kago except those we've talked. But I found a strange behavior in a some situation. I have an opened table in admin panel and I have my project running in a browser and pulling data from that table. So I manually change some value in a table via admin, refresh page with my app, it pulls changed data from database. It's simple use case (I did this for testing). So in some point of time I found out that server hangs. Just do not respond on any routes it has.
First I thought this was related to admin panel and tried this way: change data and logoff, then refresh app page. Firstly I thought it helped, but not. Hangs became less, but not disappeared. And finally I've arrived at a decision that admin panel has nothing to do with.
After all, I have decided that this is SSE influences. When I turn it off (I have a connection to a server), there is no any hangs, everything works well. I thought I have a mess with mutexes in my broker that processes user's SSE connections (store them, send message to a specific user and so), but no, looks like it is not. I have even written several variants of brokers and it behaves the same way. But I found that ctx.Done() in most cases doesn't return event on closing the connection. So just refreshing the page with SSE connection doesn't raise that event for previous broken by refresh connection. So every refresh adds new connection and not dropping the previous. So, they accumulate on server side.
Maybe that's that's reason? I don't know. To be true - sometimes I saw the message on closing connection, but very rarely. Well, a bit tired with this, so maybe will try with websockets. It is interesting how they will behave.
Beta Was this translation helpful? Give feedback.
All reactions