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

Allow choosing list of HTTP codes vaurien.behaviors.error.Error uses #24

Open
peritus opened this issue Apr 30, 2013 · 3 comments
Open

Comments

@peritus
Copy link

peritus commented Apr 30, 2013

First: Thanks for this monkey! Writing fault-tolerant services is fun again!

However:

https://github.com/mozilla-services/vaurien/blob/master/vaurien/behaviors/error.py

isn't particularly configurable or extension-friendly. I'd like to choose the list of http error codes (perhaps by subclassing the behavior).

BTW: Docs aren't telling me how to add a custom behaviour once I have written one. How do I tell the vaurien-command to Behavior.register() it ? Some entry_point magic ? Is there an example maybe ?

so long,

@tarekziade
Copy link
Collaborator

We're sending back a random http error from the 5xx list: https://github.com/mozilla-services/vaurien/blob/master/vaurien/behaviors/error.py#L89

but yeah, we could add an option to let the user pick one!

Docs aren't telling me how to add a custom behaviour once I have written one.

as shown here: https://vaurien.readthedocs.org/en/1.7/#using-vaurien-from-the-command-line

you can specify a --behavior option in the command line or the ini file

@peritus
Copy link
Author

peritus commented Apr 30, 2013

Thanks for the docs pointer!

My reasoning behind this is, I want to test a service that should behave differently for 502/503 (retry with exponential backoff) than for 500 (log the error, abort the job).

@tarekziade
Copy link
Collaborator

Yeah that makes total sense. If you're building a plugin derived from the http for this, we can merge it in the http one once it's ready

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

No branches or pull requests

2 participants