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

(Discussion): allow multi trigger to continue if a trigger exits successfully #2419

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

karthik2804
Copy link
Contributor

To enable running other triggers along with the command trigger as per fermyon/spin-trigger-command#7

This PR just focuses on enabling the ability for multi-triggers to continue if one of them exits successfully.

@itowlson
Copy link
Contributor

itowlson commented Apr 3, 2024

I'm not sure this is the right default. For most triggers, if the trigger is no longer accepting events, the application is not doing what you want it to do, and should exit.

We have various options here. I thought of:

  1. Do this and hope that no eventful trigger ever exits with code 0.
  2. Have a manifest setting where the developer can mark a trigger as "continue after exit".
  3. Add a field to the trigger launch metadata where a trigger can report itself as "expect me to terminate and continue without me".

I am wary of 1. 3 is convenient for application developers which is nice, but I don't know if it provides enough flexibility for the command use case (what if someone writes a side-car-like command that is expected to stay up for the lifetime of the application? We can't assume init containers are the only use case for this). 2 feels like a tedious task that the app developer has to remember to do every time. Any other ideas?

@itowlson
Copy link
Contributor

itowlson commented Apr 3, 2024

Looking at the original issue, it also seems to express a requirement that (in the author's particular case), the other triggers do not start until the command trigger has successfully exited. If that's the case, we'll need significantly greater structural changes...

@karthik2804
Copy link
Contributor Author

Those are some valid concerns, if we do not want to rely on triggers being well-behaved. I like the explicitness of option 2, it also potentially sets a way for the manifest to also define if certain triggers need to be run serially or parallelly.

@karthik2804 karthik2804 changed the title allow multi trigger to continue if a trigger exits successfully (Discussion): allow multi trigger to continue if a trigger exits successfully Apr 3, 2024
@karthik2804 karthik2804 marked this pull request as draft April 3, 2024 20:14
@lann
Copy link
Collaborator

lann commented Apr 3, 2024

fermyon/spin-trigger-command#7 (comment)

Another option would be a e.g. --sleep-forever-on-completion flag that causes this trigger to...sleep forever on completion. If all its resources were dropped before sleeping this process would likely have very little overhead.

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

Successfully merging this pull request may close these issues.

3 participants