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

Add logging during setup process and ensure we're reacting to start hook #130

Merged
merged 11 commits into from
Oct 25, 2023

Conversation

mthaddon
Copy link
Contributor

@mthaddon mthaddon commented Oct 21, 2023

Overview

We need to react to the start event for _set_up_discourse rather than the install event, because if a container is restarted it won't get an install event.

Add logging to the _set_up_discourse method so it's easier to see at what point during the process this is failing. In production (likely due to poor disk IO related to https://bugs.launchpad.net/juju/+bug/1989004, still to be confirmed) we're seeing issues where if containers are restarted and we can end up with the set up process failing and so discourse never being started.

This only seems possible if we enter the _set_up_discourse method, relations are ready and we can connect to the container, but then somewhere later on in this same method we fail to complete the setup.

This should help us track down where that's happening.

Checklist

@mthaddon mthaddon requested a review from a team as a code owner October 21, 2023 05:03
@mthaddon mthaddon marked this pull request as draft October 21, 2023 05:13
@nrobinaubertin nrobinaubertin mentioned this pull request Oct 22, 2023
6 tasks
nrobinaubertin
nrobinaubertin previously approved these changes Oct 22, 2023
@nrobinaubertin
Copy link
Collaborator

This is probably blocked by a dependency issue that I'm trying to solve here: #125

@nrobinaubertin nrobinaubertin marked this pull request as ready for review October 24, 2023 20:20
weiiwang01
weiiwang01 previously approved these changes Oct 25, 2023
arturo-seijas
arturo-seijas previously approved these changes Oct 25, 2023
Copy link
Collaborator

@arturo-seijas arturo-seijas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nrobinaubertin
Copy link
Collaborator

I have the same issue locally as https://github.com/canonical/discourse-k8s-operator/actions/runs/6632062737/job/18039459125#step:13:139

But not when I switch back to 'install' instead of 'start'

@nrobinaubertin nrobinaubertin dismissed stale reviews from arturo-seijas, weiiwang01, and themself via bdab324 October 25, 2023 14:40
@github-actions
Copy link
Contributor

Test coverage for 659472e

Name              Stmts   Miss Branch BrPart  Cover   Missing
-------------------------------------------------------------
src/charm.py        314     38     86     17    86%   127, 129, 138, 140, 148-149, 289->294, 456-457, 469-471, 476-477, 488-490, 495-496, 508-510, 515-516, 528-530, 556-558, 598->exit, 605-606, 608->exit, 614, 642-648, 674->exit, 688-689, 699->exit, 713
src/database.py      30      1      8      1    95%   56
-------------------------------------------------------------
TOTAL               344     39     94     18    87%

Static code analysis report

Run started:2023-10-25 16:29:44.576356

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 1831
  Total lines skipped (#nosec): 1
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

Copy link
Contributor

@amandahla amandahla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nrobinaubertin nrobinaubertin merged commit c2e2f83 into main Oct 25, 2023
28 checks passed
@nrobinaubertin nrobinaubertin deleted the logging-start-event branch October 25, 2023 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants