toxiproxy
toxiproxy copied to clipboard
Add Bidirectional Toxics
This is in preparation for adding an HTTP toxic as well as enabling other protocol-aware toxics.
This PR does a few things:
- Keeps track of paired links so that for example an
downstream
link can reference anupstream
link. - Adds the idea of paired toxics, allowing for an
upstream
anddownstream
toxic to share a state object. - Hides toxics with a blank name so that internal toxics aren't visible (A bidirectional toxic actually creates 2 toxics).
- Handles toxicity so that paired toxics are always in the same state
- Lots of tests
Updates to CHANGELOG.md
and CREATING_TOXICS.md
to come.
I think this should be ready for review now, @Sirupsen Feel free to add some other people to review, I'm not sure who else is interested in Go + Toxiproxy right now.
The WIP http toxic is here: https://github.com/Shopify/toxiproxy/blob/http-toxic/toxics/http.go And another example of an implemented bidirectional toxic is in the tests: https://github.com/Shopify/toxiproxy/blob/bidirectional-toxics/toxics/bidirectional_test.go#L17
@jpittis is this something you'd be interested in reviving? Protocol aware toxics would be awesome (https://github.com/Shopify/toxiproxy/issues/50).
+1. This seems very useful.
I was hacking together a MS SQL TDS aware toxic to cut off connections when given batch or RPC calls are sent upstream. If this ever gets anywhere then give me a nudge and i will finish it off 😄