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

Multiple flapping triggers for a single process #152

Closed
smt116 opened this issue Sep 23, 2015 · 7 comments
Closed

Multiple flapping triggers for a single process #152

smt116 opened this issue Sep 23, 2015 · 7 comments
Milestone

Comments

@smt116
Copy link
Contributor

smt116 commented Sep 23, 2015

Hi there,

is it possible to achieve something like:

trigger :flapping, times: 3, within: 2.minutes, retry_in: 5.minutes
trigger :flapping, times: 6, within: 10.minutes, retry_in: 60.minutes

?

I know that there is retry_times, but I guess that it will require manual start after that. Am I right?

@kostya
Copy link
Owner

kostya commented Sep 23, 2015

try:

trigger :flapping1, times: 3, within: 2.minutes, retry_in: 5.minutes
trigger :flapping2, times: 6, within: 10.minutes, retry_in: 60.minutes

after retry_times, you can start only by hands.

@kostya kostya closed this as completed Sep 23, 2015
@smt116
Copy link
Contributor Author

smt116 commented Sep 23, 2015

Thanks. I didn't know that I can just provide another name ;)

@smt116
Copy link
Contributor Author

smt116 commented Sep 24, 2015

It will not work. Eye will pick only the "shorter" one.

@kostya
Copy link
Owner

kostya commented Sep 24, 2015

what you expect?

@smt116
Copy link
Contributor Author

smt116 commented Sep 24, 2015

trigger :flapping1, times: 3, within: 2.minutes, retry_in: 5.minutes
trigger :flapping2, times: 6, within: 10.minutes, retry_in: 60.minutes
  1. process crashed
  2. eye tries to bring it up
  3. it tries 3 times within 2 minutes
  4. all tries were failed so it pauses for 5 minutes
  5. eye tries again after 5 minutes
  6. it tries 6 times within 10 minutes
  7. all tries were failed so it pauses for another 60 minutes
  8. back to the step 1

I have a case when process depends on a database. It will crash when user will restore a wrong database backup. Eye will keep sending an alert each 5 minutes till the database is fixed or someone from our supports takes an action.

@kostya kostya reopened this Oct 3, 2015
@kostya kostya added this to the 0.8 milestone Oct 3, 2015
@kostya
Copy link
Owner

kostya commented Oct 3, 2015

i think about this:
trigger :flapping, times: 3, within: 2.minutes, retry_in: 5.minutes, retry_times: 3, reretry_in: 60.minutes, reretry_times: 3

@smt116
Copy link
Contributor Author

smt116 commented Oct 5, 2015

For me it is a "good enough" solution, but not sure about these names. What if someone in the future will ask about one more step? rereretry? ;) Maybe better would be some hash as an option? or support for multiple definitions?

@kostya kostya closed this as completed in 8bacc3a Nov 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants