toxiproxy icon indicating copy to clipboard operation
toxiproxy copied to clipboard

Add Bidirectional Toxics

Open xthexder opened this issue 7 years ago • 5 comments

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 an upstream link.
  • Adds the idea of paired toxics, allowing for an upstream and downstream 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

xthexder avatar Sep 14 '16 20:09 xthexder

Updates to CHANGELOG.md and CREATING_TOXICS.md to come.

xthexder avatar Sep 14 '16 20:09 xthexder

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

xthexder avatar Sep 14 '16 21:09 xthexder

@jpittis is this something you'd be interested in reviving? Protocol aware toxics would be awesome (https://github.com/Shopify/toxiproxy/issues/50).

sirupsen avatar Mar 19 '17 23:03 sirupsen

+1. This seems very useful.

mmollaverdi avatar May 02 '17 06:05 mmollaverdi

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 😄

mgkeen avatar Nov 16 '17 13:11 mgkeen