Open ljwagerfield opened 4 years ago
I have seen this error while trying to fix another error, which may be a clue what's happening here: https://github.com/AsyncHttpClient/async-http-client/issues/1660
Interesting that yours happens 'under load': mine does not.
More interestingly, I found the sequence of GET, GET, DELETE, DELETE, POST (with body), GET seemed to make the error surface more frequently than other combinations:
val requests: List[Request[Task]] = List(
Request(
Method.GET,
Uri.unsafeFromString(url)
),
Request(
Method.GET,
Uri.unsafeFromString(url)
),
Request(
Method.DELETE,
Uri.unsafeFromString(url)
),
Request(
Method.DELETE,
Uri.unsafeFromString(url)
),
Request(
Method.POST,
Uri.unsafeFromString(url),
).withEntity(
"BANG!"
),
Request(
Method.GET,
Uri.unsafeFromString(url)
),
)
When using an HTTP4S
0.21.1
client (aync-http) and a HTTP4S server (blaze), I frequently receive the following errors onGET
requests that occur immediately afterPOST
requests with a string body"BOOM!"
.Reproduction code: https://github.com/ljwagerfield/http4s-request-body-error
More detail:
The problem is caused by
withEntity("BOOM!")
. However, thePOST
request with that body succeeds, but the subsequentGET
fails: theGET
is never sent to the server, and instead the above exception occurs.The problem goes away if I use a different backend (e.g.
python -m SimpleHTTPServer
), implying Blaze Server manages to get HTTP4S AHC into a bad state.The fact that HTTP4S AHC is able to be put into such a state by a server, such that the subsequent request fails before it's even sent to the server implies a bug with HTTP4S AHC... there may also be a separate bug with Blaze Server.