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

Better handling when things go wrong #406

Open
oxinabox opened this issue Apr 19, 2018 · 3 comments
Open

Better handling when things go wrong #406

oxinabox opened this issue Apr 19, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@oxinabox
Copy link

Every few weeks something weird happens and one of the connections I am bridging breaks,

Most-often it is gitter.
Now, I don't want this fixed as such.
What I want is for a better way to handle it.

[2018-04-18T20:44:00+08:00] ERROR gitter:       connection with gitter closed for room JuliaLang/julia
[2018-04-18T20:44:00+08:00] ERROR gitter:       connection with gitter closed for room JuliaDiffEq/Lobby
[2018-04-18T20:44:08+08:00] ERROR gitter:       connection with gitter closed for room tbreloff/Plots.jl
[2018-04-18T20:44:25+08:00] ERROR gitter:       connection with gitter closed for room JunoLab/Juno
[2018-04-18T20:44:25+08:00] ERROR gitter:       connection with gitter closed for room JuliaGraphs/LightGraphs.jl
[2018-04-18T20:44:25+08:00] ERROR gitter:       connection with gitter closed for room FluxML/Lobby

This error happens. My gitter connection goes down, but the program keeps running.
However, I am not aware of it, until hours or days later since it takes a while before anyone notices that it isn't bridging (since you have to be in both chatrooms or have to be reading the logs)

I'ld rather any errors just fully crash the program,
I have it running in a script that will restart it if that occurs.

I

@jheiselman
Copy link
Contributor

Most of the platform libraries (gitter, discord, slack, etc...) don't really have any good method for matterbridge to check the status of the connection and don't maintain anything as simple as a state value.

@42wim just thinking out loud, what if messages triggered something like a heartbeat that the bridge could track. I know that some (most?) of the supported platforms include a "ping" message. Maybe something can be done with that?

@42wim 42wim added the enhancement New feature or request label May 7, 2018
@42wim
Copy link
Owner

42wim commented May 7, 2018

@jheiselman Yes, maybe. I'll have to look into this.
Also related to #116

@jheiselman
Copy link
Contributor

Just logging this information here:

XMPP platforms support an XMPP ping that can be used to determine connection health.
Slack has the periodic LatencyReport event that can be used for the same purpose.
Discord has a heartbeat event with results stored in Session.LastHeartbeat(Sent|Received).
IRC servers usually implement a PING command. Something like "/PING NickServ" may prove to work for most situations. Making the ping command configurable may be a good long term solution.
Telegram has an API endpoint called help.getNearestDc that could be used as a sort of connection check.

I'm unfamiliar with any other platforms, but hope that someone can help build on this.

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

No branches or pull requests

3 participants