-
Notifications
You must be signed in to change notification settings - Fork 6
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
Rework handling of the pebble_ready event #146
Conversation
Out of curiosity: From the doc Lifecycle events, while deploying the charm, this happens: install -> config-changed -> start -> -pebble-ready Would this make the set up discourse run twice? |
Yes, indeed. This is probably why it is subject to timeouts here. I need to fix this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a step towards moving discourse to be compliant with the architecture guidance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, the comments are worth having a look at.
While reading this I was thinking: "why not handle only pebble ready event?" |
The pebble ready event can occur when the relations don't exist or are not ready. So if we don't defer, it doesn't allow us to be sure that the charm will go through the setup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, minor comments and questions. Thank you!
594be1c
Test coverage for 4ebe987
Static code analysis report
|
Overview
We discovered that in cases where the workload container gets restarted on its own, only a pebble_ready event would be thrown by juju and the container would not be correctly re-planned.
This PR handles pebble_ready event correctly and adds a named function for each event we listen to. This is a step towards "managing charm complexity", allows us to have more fine grained logging and handling of events.
During the creation of the PR, it was noted that the redis_relation_changed handler didn't try to setup discourse as needed, so it was added.
Checklist
src-docs
urgent
,trivial
,complex
)