-
Notifications
You must be signed in to change notification settings - Fork 24
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
Strange WouldBlock errors. #70
Comments
Can you check what the |
Its running in docker (on an alpine image), I just checked:
|
Hmm ok. 1048576 file descriptors should be plenty. Before we investigate further can you try an image that uses gblic instead of musl, like debian? |
One big difference is that due to isahc using curl, it probably ends up doing connection pooling and hence reusing ports while we will always open a new connection for each request (actually multiple new connections due to happy eyeballs). Hence it could be that you are running out of ports? Could you check if you have a lot of TCP connections in the |
I took a lot at the man pages for the syscalls we use. We don't use nonblocking sockets so it pretty much eliminates
|
But we do use |
This is probably non-sense as |
I think I found our culprit: https://doc.rust-lang.org/stable/std/net/struct.TcpStream.html#platform-specific-behavior-1 So @dessalines Could you try to modify that value using |
Ya I'll try that in a bit here. |
Yep, tried upping to a 300 second read timeout, it failed after that full time was up, same error:
I think all the posts are going through, but the gets are failing: let timeout = Duration::from_secs(300);
let text: String = attohttpc::get(url.as_str())
.header("Accept", APUB_JSON_CONTENT_TYPE)
.connect_timeout(timeout)
.read_timeout(timeout)
.timeout(timeout)
// .body(())
.send()?
.text()?;
let res: Response = serde_json::from_str(&text)?; This full error log probably won't be that useful, but since most of the errors are tokio / actix related, my guess is there's some thread fighting between actix and attohttpc that isahc for some reason doesn't have. |
attohttpc is completely synchronous blocking the current thread whereas isahc is an asynchronous binding to curl that will allow tokio/actix to continue making progress on that thread. Do you use actix's |
(This might be considered bad marketing or something, but since you already use actix and seem to be motivated by reducing your dependencies, have you considered using actix' own HTTP client awc?) |
I've been investigating a potentially similar problem, but I believe I've been able to rule out I only see this issue with one (internal) service, and testing with curl I originally did not see the problem. But then I used the It seems both |
We're trying to convert our code in lemmy to use attohttpc, (we were using isahc previously), but when doing a lot of concurrent attohttpc gets and posts (in actix threads), we're getting a lot of
WouldBlock
errors :We also tried disabling the tls (since that's the only instance of wouldblock we could find), but it didn't help.
For some reason isahc doesn't have these issues.
Related issue : LemmyNet/lemmy#840
The text was updated successfully, but these errors were encountered: