toxiproxy icon indicating copy to clipboard operation
toxiproxy copied to clipboard

Upstream aware toxics

Open chbatey opened this issue 6 years ago • 3 comments
trafficstars

I'd like to be able to write toxics that are upstream aware e.g. drop if client's IP = x.

This will be useful for testing peer 2 peer systems rather than client server.

The usecase I have in mind is for a service that forms a cluster e.g. a Cassandra Cluster or an Akka Cluster I'd like to have toxi proxy between each P2P connection and be able to simulate a node misbehaving. As these are P2P systems each node will connect to a subset of other nodes so I only wan to disrupt incoming traffic from a given source.

To support this I think we'd need to add more information to ToxicStub or create a new toxic type.

WDYT? Is this something you'd accept if I worked on it?

chbatey avatar Feb 11 '19 08:02 chbatey

Heya @chbatey!

One way to do that would be to add more information about the connection to the ToxicStub as you suggest. I can't think of a better approach. I think we'd accept something like this.

(Mostly unrelated, FYI that https://github.com/Shopify/toxiproxy/issues/50 protocol aware toxics have been a WIP for a while.)

jpittis avatar Feb 11 '19 12:02 jpittis

Thanks @jpittis I raised https://github.com/Shopify/toxiproxy/pull/246 and have been testing with it and some custom toxics and it works. We could instead not have a toxic added to the link rather than all the toxics that want to be client specific doing the check.

chbatey avatar Feb 13 '19 07:02 chbatey

I'm not sure how useful this is, since it's a fairly old PR, but some of the code in https://github.com/Shopify/toxiproxy/pull/132 might be helpful for this.

xthexder avatar Feb 13 '19 08:02 xthexder