Replies: 2 comments 2 replies
-
Hi @aviflax, AsyncHTTPClient's connection pooling code has recently gone through a major refactor. This is a new error being returned by the package. From the error name it sounds like you are running many uploads at the same time and the HTTP client is running out of connections. It would probably be best to ask on the AsyncHTTPClient what is the best action to take. If the cause is because you are pushing too many requests to S3 simultaneously you will have to build a queue to process these requests. I have an implementation of a queue which controls how many tasks can run concurrently here if you want to use that. Warning it is not heavily tested. |
Beta Was this translation helpful? Give feedback.
-
Hi @adam-fowler thank you so much for the rapid and thorough reply!
Makes sense. I’ll do that. BTW what do you think about my idea that Soto should either wrap this error, or add it to the page Error Handling in the documentation, so that users of the library know that they might want to handle it?
That makes sense. I’ll give it a try. Thanks again! |
Beta Was this translation helpful? Give feedback.
-
Hi, I’m a seasoned developer but I’m new to Apple development and new to Swift.
I’m writing a Mac CLI program and I’m trying to upload some files to BackBlaze B2 using its S3-compatible API. I’m using Soto 5.11.0 and Xcode 13.2, and I’m using the ~new Swift concurrency features (async/await).
I’m seeing that my calls to
S3.putObject
are usually succeeding, but they’re sometimes failing by throwingAsyncHTTPClient.HTTPClientError
— specifically,HTTPClientError.getConnectionFromPoolTimeout
.I think I have two questions here:
AWSClientError
,AWSServerError
, andAWSResponseError
. When I wrote mycatch
clauses expecting those error types, they didn’t catch theseHTTPClientError
values because of course they are of a different type. This could just be due to my lack of experience with Swift, but I find this surprising. I’d have thought that the docs would describe all the possible error types that could be thrown. Often, a library will constrain the errors that are thrown by wrapping various types of errors in a standard error type… couldn’t these instances ofHTTPClientError
be wrapped in instances ofAWSClientError
and exposed via a property? Or am I missing something?error
to stdout withprint
(in a string interpolation) and all I get isHTTPClientError.getConnectionFromPoolTimeout
— literally just that. I looked at the source forHTTPClientError
inHTTPClient.swift
from the AsyncHTTPClient library, and this type doesn’t seem to include any properties containing details about what actually went wrong, which is confusing to me.Thank you!
Beta Was this translation helpful? Give feedback.
All reactions