-
Notifications
You must be signed in to change notification settings - Fork 448
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
Toxiproxy 2.0 RFC #54
Comments
What's the plan for ensuring the toxic has finished sending output after being interrupted, and before the connections are changed? Wait for Also 👍 for the API. Have you thought about allowing control of the toxic ordering? That might be useful in some cases, but maybe not enough to be worth the extra complexity. |
Another thing for the implementation: |
🆒 |
Wouldn't it be more restful to do:
But only allow certain names? |
👍 @sirupsen That means it also exactly matches how proxies are created. |
👍 to the API and design |
Another interpretation to the API would be that all the toxics are created on the resource by default, and you have to do a |
Missed this before (maybe because it was edited in after): toxic order is determined by the order toxics are created in, since we'll always append to the end of the chain. In the general use case, this works well since I don't see a need to reorder toxics without removing them all first. I think the idea of adding/removing toxics vs enabling/disabling is what we want. It seems to be what people are expecting, and it will scale better if/when we have many types of toxics (I expect there will end up being many protocol-aware toxics) |
@sirupsen |
👍 |
We need to remember to remove the |
Proposed API Changes
enabled
field from all toxicsPOST /proxies/{proxy}/{up|down}stream/toxics
- Create (enable) a new toxicPOST /proxies/{proxy}/{up|down}stream/toxics/{toxic}
- Update an existing toxicDELETE /proxies/{proxy}/{up|down}stream/toxics/{toxic}
- Destroy (disable) a toxicThis API matches the current proxy creation/deletion api.
Internal Structure Changes
Current 1.x architecture: https://docs.google.com/drawings/d/1pwuRINbpwyaQeYSgGt8VTEKWEUQAwYpNJIMH1owW3Sc/view
Instead of a static number of
ToxicStubs
(and a static mapping for each toxic),ToxicStub
s will be dynamically added / removed as toxics are created/destroyed. A minimum of 1ToxicStub
will always be present, and the first toxic will always be aNoopToxic
so that it can be interrupted for inserting / removing toxics.Steps for adding a new toxic:
ChanReader
ToxicStub
s with their toxicsSteps for removing a toxic:
ToxicStub
pairThis ends up being very similar to a doubly-linked list, except that we need to ensure no data is in-flight between the links (channels) when they're removed.
Toxic Registration
The
main()
function and server creation will be simplified so that it can be used as a library.Instead of having all the toxics hard-coded inside toxiproxy, they will be registered in an
init()
function:toxiproxy.Register(SomeToxic)
(this will have to be done with reflection or something...)This will allow user-created toxics without having to create a full fork of toxiproxy.
The text was updated successfully, but these errors were encountered: