-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Error: IncompleteMessage: connection closed before message completed #2136
Comments
This is just due to the racy nature of networking. hyper has a connection pool of idle connections, and it selected one to send your request. Most of the time, hyper will receive the server's |
Hey, thank you for the swift response! I got it! So the connection is being reused, right? It is due the keep-alive option? Also, I could not reproduce the error when requesting a url over If that is the reason, I should experienced the issue when using |
I just found that aws s3 has a default max idle timeout of 20s, and hyper's default keep_alive_timeout is 90s. Settings the keep_alive_timeout to less than 20s on hyper client seems to have solved the problem! Thank you, your explanation really help me to understand why this was happening! |
I was looking at the java aws client, and I saw that they use the max-idle-timeout as 60s, but there is a second property called validate-after-inactivity (5s default) that allows the idle timeout be so high. It would be possible to implement the same behavior on hyper? Does it make sense? 😄 |
I believe the "revalidation" it does is to poll that it is readable. In hyper, we already register for when the OS discovers the connection has hung up. The race would still exist, if the "revalidation" happened at the same time the server was closing. |
``` Error: Request Error when talking to qbittorrent: error sending request for url (http://localhost:6006/api/v2/torrents/delete): connection closed before message completed Caused by: 0: error sending request for url (http://localhost:6006/api/v2/torrents/delete): connection closed before message completed 1: connection closed before message completed ``` Issue: hyperium/hyper#2136
Anyone getting this with
|
Well, I tried to use |
Doesn't I've faced this problem with ClickHouse HTTP crate, however, ClickHouse sends @seanmonstar, any ideas? |
Setting pool idle timeout to a value smaller than watchtower's poll interval can fix following error: [2022-08-25T04:03:22.811160892Z INFO solana_watchtower] Failure 1 of 3: solana-watchtower testnet: Error: rpc-error: error sending request for url (https://api.testnet.solana.com/): connection closed before message completed It looks like this happens because either RPC servers or ISPs drop HTTP connections without properly notifying the client in some cases. Similar issue: hyperium/hyper#2136.
Setting pool idle timeout to a value smaller than solana-watchtower's poll interval can fix following error: [2022-08-25T04:03:22.811160892Z INFO solana_watchtower] Failure 1 of 3: solana-watchtower testnet: Error: rpc-error: error sending request for url (https://api.testnet.solana.com/): connection closed before message completed It looks like this happens because either RPC servers or ISPs drop HTTP connections without properly notifying the client in some cases. Similar issue: hyperium/hyper#2136.
Setting pool idle timeout to a value smaller than solana-watchtower's poll interval can fix following error: [2022-08-25T04:03:22.811160892Z INFO solana_watchtower] Failure 1 of 3: solana-watchtower testnet: Error: rpc-error: error sending request for url (https://api.testnet.solana.com/): connection closed before message completed It looks like this happens because either RPC servers or ISPs drop HTTP connections without properly notifying the client in some cases. Similar issue: hyperium/hyper#2136.
Setting pool idle timeout to a value smaller than solana-watchtower's poll interval can fix following error: [2022-08-25T04:03:22.811160892Z INFO solana_watchtower] Failure 1 of 3: solana-watchtower testnet: Error: rpc-error: error sending request for url (https://api.testnet.solana.com/): connection closed before message completed It looks like this happens because either RPC servers or ISPs drop HTTP connections without properly notifying the client in some cases. Similar issue: hyperium/hyper#2136. (cherry picked from commit 798975f)
Setting pool idle timeout to a value smaller than solana-watchtower's poll interval can fix following error: [2022-08-25T04:03:22.811160892Z INFO solana_watchtower] Failure 1 of 3: solana-watchtower testnet: Error: rpc-error: error sending request for url (https://api.testnet.solana.com/): connection closed before message completed It looks like this happens because either RPC servers or ISPs drop HTTP connections without properly notifying the client in some cases. Similar issue: hyperium/hyper#2136. (cherry picked from commit 798975f)
### Description Applies the fix in #2384 everywhere an `HttpClient` is constructed via rusoto. It lowers the S3 timeout to 15s based on tips in [this thread](hyperium/hyper#2136 (comment)), to avoid `Error during dispatch: connection closed before message completed` errors. Note that we'll probably still run into these issues, but less frequently ([source](rusoto/rusoto#1766 (comment))). ### Drive-by changes <!-- Are there any minor or drive-by changes also included? --> ### Related issues <!-- - Fixes #[issue number here] --> ### Backward compatibility <!-- Are these changes backward compatible? Are there any infrastructure implications, e.g. changes that would prohibit deploying older commits using this infra tooling? Yes/No --> ### Testing <!-- What kind of testing have these changes undergone? None/Manual/Unit Tests -->
Applies the fix in #2384 everywhere an `HttpClient` is constructed via rusoto. It lowers the S3 timeout to 15s based on tips in [this thread](hyperium/hyper#2136 (comment)), to avoid `Error during dispatch: connection closed before message completed` errors. Note that we'll probably still run into these issues, but less frequently ([source](rusoto/rusoto#1766 (comment))). <!-- Are there any minor or drive-by changes also included? --> <!-- - Fixes #[issue number here] --> <!-- Are these changes backward compatible? Are there any infrastructure implications, e.g. changes that would prohibit deploying older commits using this infra tooling? Yes/No --> <!-- What kind of testing have these changes undergone? None/Manual/Unit Tests -->
Backport of #3283 Applies the fix in #2384 everywhere an `HttpClient` is constructed via rusoto. It lowers the S3 timeout to 15s based on tips in [this thread](hyperium/hyper#2136 (comment)), to avoid `Error during dispatch: connection closed before message completed` errors. Note that we'll probably still run into these issues, but less frequently ([source](rusoto/rusoto#1766 (comment))).
we intermittently receive reports that we generate a downtime issue with the decription being `IncompleteMessageError`, and our customers say that their website was in fact up, not down. According to hyperium/hyper#2136, this could be due to connection pooling / a race condition between the client and server. one of the comments suggests setting the connection pool timeout to `0`. hyperium/hyper#2136 (comment) we do not need connection pooling as we aren't making that many requests to one particular host, so there should be no effect, and we can monitor if this fixes the error. --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
### Description Applies the fix in hyperlane-xyz/hyperlane-monorepo#2384 everywhere an `HttpClient` is constructed via rusoto. It lowers the S3 timeout to 15s based on tips in [this thread](hyperium/hyper#2136 (comment)), to avoid `Error during dispatch: connection closed before message completed` errors. Note that we'll probably still run into these issues, but less frequently ([source](rusoto/rusoto#1766 (comment))). ### Drive-by changes <!-- Are there any minor or drive-by changes also included? --> ### Related issues <!-- - Fixes #[issue number here] --> ### Backward compatibility <!-- Are these changes backward compatible? Are there any infrastructure implications, e.g. changes that would prohibit deploying older commits using this infra tooling? Yes/No --> ### Testing <!-- What kind of testing have these changes undergone? None/Manual/Unit Tests -->
…ft.io (#164) We're seeing frequent errors from the deployed service when it is making requests to snapcraft.io that look like the following: ``` error sending request for url (...) Caused by: client error (SendRequest) Caused by: connection closed before message completed ``` hyperium/hyper#2136 has details on the underlying source of the error and it looks like we need to reduce the default `pool_idle_timeout` from 90s to something much shorter. Initial local testing looks like we want to drop it all the way down to 5s which is what this PR is doing, but we probably want to tune this as we determine the performance implications.
Hey, I'm experiencing a weird behavior with the hyper client when using https.
Sometimes my app in production fails to perform the request, but the same request works most of the time. I performed a load test locally to try to reproduce the problem, and I could reproduce: it is occurring ~0.02% of the times.
I guess that it could be something related to the hyper-tls, so I switched to hyper-rustls, but the same problem continue to occur.
So I tried to hit the url using http instead of https and the error went away!
The error I receive from hyper::Client::get is:
hyper::Error(IncompleteMessage): connection closed before message completed.
Follow a minimal working example to reproduce the error:
Cargo.toml:
src/main.rs:
PS: replace the
url
value with a validhttps
url. In my tests I used a small file on aws s3.I performed a local load test using hey:
Running the test for 2 minutes (
-z 120s
) was enough to see some errors appearing.Could anyone help me out? If I need to provide more information, or anything, just let me know.
Thank you!
The text was updated successfully, but these errors were encountered: