Description
Contrary to my expectations, it seems that when the toxicity of a reset_peer
toxic is set to 0, the toxic still has a residual impact on the proxy.
To pinpoint the issue, I have created a single toxic with toxicity: 0
:
{
"name": "connection_reset",
"type": "reset_peer",
"stream": "downstream",
"toxicity": 0
}
Despite the toxicity set to 0, we can still see some exceptions thrown during the test (~1 every 10 seconds). This only happens when using toxiproxy.
The README states
toxicity: probability of the toxic being applied to a link
A toxicity value of 0 then means that the toxic has no probability of being applied, suggesting that it is the same as not having the toxic defined at all. However, this was not what I observed.
Evidence
To make sure the exceptions were not caused by my server, I conducted a test where I created a single toxic with toxicity: 0
, followed by the deletion of the toxic. I repeated this process many times, with 5-minute waits between each create and delete operation.
- Create the toxic
curl -X POST http://localhost:63264/proxies/my-proxy/toxics \
-H "Content-Type: application/json" \
-d '{
"name": "connection_reset",
"type": "reset_peer",
"stream": "downstream",
"toxicity": 0
}'
- Delete the toxic
curl -X DELETE http://localhost:63264/proxies/my-proxy/toxics/connection_reset
When the toxic is deleted, the proxy operates without issue. However, when it is introduced with toxicity set to 0, it causes some requests to fail with "Connection reset" errors. The chart below highlights this difference.
Conclusion
Based on the documentation, I expected that a toxicity of 0 would mean the toxic would have no effect, but the observed behavior suggests that toxicity: 0
does not completely disable the toxic.
Activity