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

Discord bot account offline but xud-docker-bot service running #17

Open
reliveyy opened this issue Aug 28, 2020 · 4 comments
Open

Discord bot account offline but xud-docker-bot service running #17

reliveyy opened this issue Aug 28, 2020 · 4 comments
Assignees
Labels
P2 mid priority

Comments

@reliveyy
Copy link
Collaborator

No description provided.

@reliveyy
Copy link
Collaborator Author

reliveyy commented Sep 4, 2020

Experience this issue again

@reliveyy reliveyy added the P1 top priority label Sep 4, 2020
@kilrau kilrau added this to To do in Hardening via automation Sep 7, 2020
@kilrau
Copy link

kilrau commented Sep 7, 2020

I don't understand how the discord but account can be offline in the first place, but ... will the discord account come "online" by itself or is there anything you actively need to do?

Plus since this os only affecting discord notification messages and manual builds, but not auto build functionality this shouldn't be that serious.

@kilrau kilrau removed this from To do in Hardening Sep 7, 2020
@reliveyy
Copy link
Collaborator Author

reliveyy commented Sep 9, 2020

A short explaination about the possible reason why this issue happens:

The bot application is running in a single thread which runs an event loop in it. The Discord client, HTTP server and modified images analyzing routine are all running in the same thead. That means when the analyzing routine took minutes to finish its job the Discord client may disconnect (but this still cannot explain why it does not reconnect back). So in order to make the program fully async 2 major parts need to be refactored:

  1. The clients for dockerhub and travis
  2. The modified images analyzing routine

After 2 days trying I found that it couldn't be done in a short time (like one day). So here are the steps I suggest we should take to resolve this issue incrementally:

  • Write an endpoint to check if the Discord client is working well in the bot application (resolved by feat: add health endpoint #21)
  • Create a cron job to query the endpoint. If it shows the Discord client is not working then sudo systemctl restart xud-docker-bot
  • Log more details in xud-docker-bot (may introduing structlog) try to find if there are some concurrency issues
  • Introducing guppy3 and objgraph to diagnose if there are some memory leaks in the application

@kilrau kilrau added P2 mid priority and removed P1 top priority labels Sep 9, 2020
@kilrau kilrau added this to To do in Hardening via automation Sep 9, 2020
@kilrau
Copy link

kilrau commented Sep 9, 2020

  • Write an endpoint to check if the Discord client is working well in the bot application
  • Create a cron job to query the endpoint. If it shows the Discord client is not working then sudo systemctl restart xud-docker-bot

As discussed, I think these two are enough for now.

@kilrau kilrau removed this from To do in Hardening Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 mid priority
Projects
None yet
Development

No branches or pull requests

2 participants