Skip to content
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

Reset peer toxic #333

Merged
merged 2 commits into from
Oct 17, 2021
Merged

Reset peer toxic #333

merged 2 commits into from
Oct 17, 2021

Conversation

miry
Copy link
Contributor

@miry miry commented Oct 16, 2021

Modify the proposal from #247.

Testing and benchmarking.

Testing

$ toxiproxy-cli -h http://localhost:8474 create -l localhost:20000 -u localhost:20002 http
$ toxiproxy-cli toxic add --type reset_peer --toxicName "reset_peer" \                            
                       --attribute "timeout=2000" \
                       --toxicity 1.0 http
$ time curl 127.0.0.1:20000
curl: (56) Recv failure: Connection reset by peer
curl 127.0.0.1:20000  0.00s user 0.00s system 0% cpu 2.010 total

Setup the reset peer toxic and got message:

    benchmark_test.go:56: Get "http://localhost:20000/test1": read tcp 127.0.0.1:57262->127.0.0.1:20000: read: connection reset by peer

@miry miry self-assigned this Oct 16, 2021
@miry miry marked this pull request as ready for review October 16, 2021 11:52
@miry miry added this to the 2.2.0 milestone Oct 16, 2021
@StevenACoffman
Copy link

StevenACoffman commented Oct 16, 2021

Woohoo! Thanks for picking this back up again! Thanks for the original work @chaosbox

@miry miry force-pushed the RFC-reset-conn-toxic branch 2 times, most recently from 77e0041 to 44f995f Compare October 17, 2021 16:04
Update documentation to mention about reset_peer toxic.
Add e2e smoke tests to check format of reset_peer toxic.
Client show the toxic in the help usage output.

Example of usage:

```shell
$ toxiproxy-cli -h http://localhost:8474 create -l localhost:20000 -u localhost:20002 http
$ toxiproxy-cli toxic add --type reset_peer --toxicName "reset_peer" \
                       --attribute "timeout=2000" \
                       --toxicity 1.0 http
$ time curl 127.0.0.1:20000
curl: (56) Recv failure: Connection reset by peer
curl 127.0.0.1:20000  0.00s user 0.00s system 0% cpu 2.010 total
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants