Toxic with toxicity: 0 still affects proxy
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 12.4k
- Forks
- 510
- PR merge metrics
- No merged PRs in 30d
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the provided curl commands: create a downstream reset_peer toxic with toxicity 0, observe proxy requests, then delete it for comparison. Trace how reset_peer toxicity is handled and add or update coverage for zero toxicity. Done means toxicity 0 produces no more connection resets than having no toxic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100