Skip to content
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

Presence issue in cluster mode #304

Closed
postacik opened this issue Jan 24, 2020 · 13 comments · Fixed by #313
Closed

Presence issue in cluster mode #304

postacik opened this issue Jan 24, 2020 · 13 comments · Fixed by #313
Labels

Comments

@postacik
Copy link

Hi,

We have a problem with the following scenario:

A is connected to cluster1 and subscribes to "channel/" and also subscribes to presence of "channel/".
B is connected to cluster2 and subscribes to "channel/" and also subscribes to presence of "channel/".

When A disconnects from cluster1, B gets an "unsubscribe" event with the id of A.

But when cluster1 goes down while A is still connected, B does not get an "unsubscribe" event.

Is this behavior by design or is it a bug?

@postacik
Copy link
Author

postacik commented Jan 26, 2020

Can you please comment on this? We built one of our functions on the presence events and this behavior makes our algorithm useless.

@postacik
Copy link
Author

Any comments?

@Florimond
Copy link
Member

Hello @postacik,

I'll have a look, discuss it with @kelindar as soon as he is available, and come back to you ASAP.

@postacik
Copy link
Author

Thanks :)

@postacik
Copy link
Author

I think a cluster does not keep subscribed channels on other clusters. Is that right?

@postacik
Copy link
Author

postacik commented Feb 9, 2020

Anything?

@kelindar
Copy link
Contributor

@postacik sorry have been busy lately. I'll have a look, but by the sound of it it sounds like a bug. I'm thinking that it could be fixed by brokers having a sort of "heartbeat" for presence and if a server goes down others can remove the connection from the presence list and hence send the event. The downside is that you might receive the "disconnect" event multiple times in case of several brokers decide to clean it up at the same time.

@kelindar kelindar added the bug label Feb 23, 2020
@postacik
Copy link
Author

Thanks. Having multiple disconnect events would not be a problem.

@postacik
Copy link
Author

Hi @kelindar , any news about this bug?

@postacik
Copy link
Author

Hi @kelindar , I hope you're well during these quarantine days. Have you had any chance to look at this issue?

@kelindar
Copy link
Contributor

Hi @postacik sorry I've been quite busy these days. Still alive and good, but didn't have much time yet to look into this.

@postacik
Copy link
Author

Thanks, I'll test it asap.

@postacik
Copy link
Author

Hi @kelindar , it seems to be fixed according to my very first tests.

We are using the "gobetween" load balancer in front of emitter clusters and trying to build a keep-alive algorithm, monitoring the presence events on a specific emitter channel.

Using this algorithm, our application servers will decide which one is primary and which one is backup.

Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants