-
Notifications
You must be signed in to change notification settings - Fork 454
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
Toxic with toxicity: 0 still affects proxy #603
Comments
Hey @fmmagalhaes! I'm trying to reproduce this behaviour with a newly created Rails app but I haven't noticed the toxic having any residual impact on the proxy when the toxicity is set to 0. The steps I followed to try and reproduce are as follows. For reference, I used a brand new Rails I created a proxy along with the same Proxy creation:
Toxic creation:
Ruby script: require 'net/http'
require 'uri'
request_count = 0
error_count = 0
max_requests = 100
while request_count < max_requests
begin
response = Net::HTTP.get_response(URI.parse("http://localhost:22220/up"))
rescue => e
puts "Error: #{e.message}"
error_count += 1
end
request_count += 1
# sleep 0.5 # I've tried with a few different values (e.g., 0.25, 0.5, 1) and without sleeping
end
puts "Requests: #{request_count}"
puts "Errors: #{error_count}" After running this script a few times with Is there anything I may be missing while trying to reproduce and are you still encountering this behaviour? |
Hello, @mattbardal On my side, the client is a Spring Boot application. While I couldn’t replicate the issue locally with the same client, it consistently occurs in my CI/CD pipeline during tests that use Toxiproxy. I’ve managed to reproduce it with two independent applications in that environment. Unfortunately, I can’t disclose much about the client itself, which I understand makes it harder to identify the problem. I have also been unable to pinpoint the exact conditions under which the issue is reproducible. However, I believe the test I shared earlier still highlights a potential issue with the toxicity mechanism. Would you agree with that assessment? |
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
: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
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.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.The text was updated successfully, but these errors were encountered: