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

Should collect-status events only be triggered after observed events? #1265

Closed
benhoyt opened this issue Jun 18, 2024 · 2 comments · Fixed by #1399
Closed

Should collect-status events only be triggered after observed events? #1265

benhoyt opened this issue Jun 18, 2024 · 2 comments · Fixed by #1399
Assignees
Labels
needs design needs more thought or spec

Comments

@benhoyt
Copy link
Collaborator

benhoyt commented Jun 18, 2024

In our discussion of @tonyandrewmeyer's change-updated spec OP045, we noted that collect-status events are currently run at the end of every hook. This is as designed and documented as "Event triggered at the end of every hook to collect statuses for evaluation."

However, @hpidcock noted that this is probably not ideal, and they should only be triggered after every hook that the charm is observing (with Framework.observe). For one thing, it's easier to cause an infinite loop of events if the charm is doing something odd in collect-status which triggers another event.

We should think through the pros/cons of this and decide whether to change it or not (changing it would strictly-speaking be backwards incompatible, but that may be acceptable here).

@benhoyt
Copy link
Collaborator Author

benhoyt commented Sep 27, 2024

We discussed briefly and consider this too problematic to change now for backwards-compatibility reasons. For example, when James was building his demo charm he used this "feature".

@benhoyt benhoyt closed this as not planned Won't fix, can't repro, duplicate, stale Sep 27, 2024
@benhoyt
Copy link
Collaborator Author

benhoyt commented Sep 27, 2024

@james-garner-canonical is going to add a little note in the docs to clarify.

@benhoyt benhoyt reopened this Sep 27, 2024
tonyandrewmeyer pushed a commit to tonyandrewmeyer/operator that referenced this issue Oct 4, 2024
…ok (canonical#1399)

For backwards compatibility, collect-status will continue to run at the end
of every hook, even if the charm does not provide any observers for that
hook. Make this explicit in the documentation. Closes canonical#1265.
tonyandrewmeyer pushed a commit to tonyandrewmeyer/operator that referenced this issue Oct 9, 2024
…ok (canonical#1399)

For backwards compatibility, collect-status will continue to run at the end
of every hook, even if the charm does not provide any observers for that
hook. Make this explicit in the documentation. Closes canonical#1265.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs design needs more thought or spec
Projects
None yet
2 participants