actix-web icon indicating copy to clipboard operation
actix-web copied to clipboard

Connect(Disconnected) when issuing a malformed request enough times

Open nmldiegues opened this issue 4 years ago • 0 comments

We faced a potential bug where enough requests malformed would cause a (awc) client to no longer be usable with a given (actix-web) server. These malformed requests had a bad value for an expected enum on the path parameters of the URL.

Steps to reproduce

  1. git clone https://github.com/nmldiegues/actix-mwe-bug.git
  2. cargo run --bin server
  3. open another shell
  4. cargo run --bin client

If you get the following error, then the problem was reproduced:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Connect(Disconnected)', bin/client/src/main.rs:21:56
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Panic in Arbiter thread.

There are a number of things that, when changed, seem to avoid the problem. Hence why this repository isn't as much of a minimal working example as I would have expected. Still, it's short enough to be compiled and ran very quickly to demonstrate the issue.

Expected and Current Behavior

No amount of malformed requests should cause the awc client from becoming unusable for correct requests. Yet, as is, sending enough bad requests (10 is actually enough) causes a subsequent correct request from failing with the error noted above.

Environment

Rust Version: 1.53.0 Actix Web Version: 3.3.2 Awc Version: 2.0.3

nmldiegues avatar Jul 20 '21 19:07 nmldiegues