-
Notifications
You must be signed in to change notification settings - Fork 456
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 api hangs when trying to do anything after a long wait, run from inside testcontainers #254
Comments
Hi @astafev! I don't have time to help you debug this, but would you be able to share a bit more information in case someone else can help? Would you be able to add:
If someone has time to help debug, I'd suggest:
Thanks! |
hi, @jpittis. I'm using testcontainers on windows. So, toxiproxy is run in docker using image shopify/toxiproxy:2.1.0. I don't know how to track the exact set of CLI commands on Toxiproxy side, but in general I'm doing the following:
Please let me know if there's some debug mode for toxiproxy so I could give you enough info from the output. I'm not a go developer, so it'd be difficult for me to make the modifications myself. |
I'm also having this same issue. After creating a simple toxic, running traffic through it, upon attempting to delete the toxic -- the toxiproxy api hangs and I see this in the log. I can't list proxies or toxics using curl or do any kind of interaction with the api until I restart toxiproxy. It just hangs. I'm using Arch Linux and the shopify/toxiproxy image. Toxiproxy is operating alongside a pile of other docker containers. It may be worth noting - I'm using https://github.com/mageddo/dns-proxy-server for local docker dns resolution. That said, via curl (on the host machine) I can add/remove proxies and toxics without issue until I make a simple http DELETE request to toxiproxy's api from within Python using the requests lib (using the same url). Python is running in a separate container. toxiproxy logs:
toxic:
|
Figured it out. Seems like something might be wonky inside toxiproxy regarding url parsing and spaces when deleting a toxic... I changed the name from Hopefully someone finds this useful in their Googling and saves them a few days of their life ;) |
We also hit this problem in one of Hazelcast enterprise tests. I spent some time investigating the issue and it seems as a race condition between and https://github.com/Shopify/toxiproxy/blob/v2.4.0/toxics/toxic.go#L93-L99 (which is called from the https://github.com/Shopify/toxiproxy/blob/v2.4.0/link.go#L201) |
Adding a reproducer from this branch: Run it with mvn clean install Prerequisities: Java 8+, Maven, Docker Expected behavior
Actual behavior |
Experiencing the same problem as mentioned by @kwart with "org.testcontainers:toxiproxy:1.17.3" and "ghcr.io/shopify/toxiproxy:2.4.0" - when trying to uncut a connection it hangs on this line: https://github.com/testcontainers/testcontainers-java/blob/7e364891eed1eda2fdc1cdfea7e5facaccc7b025/modules/toxiproxy/src/main/java/org/testcontainers/containers/ToxiproxyContainer.java#L180 |
I am experiencing the same issue with toxiproxy-server 2.3 running on a CentOS Linux ec2 instance, so no docker networking involved. Quite a lot of traffic going over that proxy at the time when the toxicity is removed, so that race condition identified by @kwart looks like a very promising lead. |
Hi. I tried to reproduce the problem with command line or golang tests. Mean time I am working on providing more o11y to the API server and removing toxic code. UPDATE 2022-08-28:
|
Seeing this warning again in the toxiproxy server log at the same time as submitting the toxicity delete that hangs: |
I got a stack trace of the hanging toxiproxy server. |
Here is a shell+docker version of my reproducer: reproducer.zip |
Thank you @mikael-carlstedt and @kwart. |
Hi. I want to share some status. Made changes in my branch: locking-problem. It contains a lot of cosmetic changes and debugging statements. Next steps:
|
Here is fix #436 |
@mikael-carlstedt @kwart @Wrent I have released a new version https://github.com/Shopify/toxiproxy/releases/tag/v2.5.0 Let me know if it works for you. |
It works in Hazelcast's tests. Thank you for the fix, @miry. |
Works for me too! Many thanks for the quick resolution @miry! |
Hello, I'm facing a weird behaviour: toxirpoxy doesn't respond to API calls, the connection just hangs and nothing happens.
Here's the setup I'm currently using toxyproxi in:
There're few containers run inside docker with testcontiners in a single docker network. Toxiproxy is used to create troubles communicating between components. So, basically, it's between all components. And when the following scenario is used:
Toxiproxy is run inside docker, tested with images shopify/toxiproxy:2.1.4 and shopify/toxiproxy:2.1.0. Below are the logs from the docker container. Please let me know if I can provide more information.
The text was updated successfully, but these errors were encountered: