-
Notifications
You must be signed in to change notification settings - Fork 50
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
How to set custom timeout duration? #572
Comments
@AlexandreBrown is there anymore context around what you are trying to do that you can share? Or a minimal reproduction? Is this a single put object request to s3 or is this part of some concurrent operation? Is it a large object? |
@aajtodd Here is some code sample. private suspend fun putS3(jsonRequest: SomeKotlinxSerializableDataClass) =
withContext(coroutineContext) {
val bodyJson = Json.encodeToString(SomeKotlinxSerializableDataClass.serializer(), jsonRequest)
val putRequest = PutObjectRequest {
bucket = outputS3Bucket
key = "$outputS3Prefix/myfile.json"
body = ByteStream.fromString(bodyJson)
}
s3Client.use {
it.putObject(putRequest)
}
} Here |
Was this something that worked before? Need to dive into which timeout is triggering. To directly answer your question though it depends which timeout we are talking about, not all of them are configurable yet. Some of the HTTP ones are if you configure an http engine explicitly. A large request shoudn't matter so this feels like a bug to me but need to reproduce. |
@aajtodd Sometimes it doesn't work on first try, sometimes it works for 1 request but then the next one fails :
|
I've been able to reproduce this with a very large upload (1GB). The 20 sec timeout is coming from the retry middleware which is erroneously applying timeouts to the whole request (including upload time). I'm a little surprised the size document you are dealing with is causing this though. I couldn't reproduce this under 500MB but that could also of course just be differences in upload speed or possibly if you have a highly concurrent environment the request is getting starved. |
Thank you for investigating @aajtodd , I will continue to investigate to seek a better understanding but it's good that at least you're able to reproduce, we'll be waiting for a fix in the meantime. Thanks a lot |
Removes a maximum per/operation timeout from the StandardRetryStrategy. There is no sensible default for this timeout since an operation could involve a large request stream. It also subjected operations to timeout in highly concurrent environments with lots of coroutines if the coroutine was starved and just didn't get a chance to run. fixes: awslabs/aws-sdk-kotlin/issues/572
Removes a maximum per/operation timeout from the StandardRetryStrategy. There is no sensible default for this timeout since an operation could involve a large request stream. It also subjected operations to timeout in highly concurrent environments with lots of coroutines if the coroutine was starved and just didn't get a chance to run. fixes: awslabs/aws-sdk-kotlin/issues/572
|
Describe the issue
I am hitting a timeout error when performing a put request.
I would like to tweak the timeout duration to be much more than 20 seconds.
Steps to Reproduce
Current behavior
The app crashes
AWS Kotlin SDK version used
0.14.0-beta
Platform (JVM/JS/Native)
JVM
Operating System and version
Ubuntu 20.04.3 LTS
The text was updated successfully, but these errors were encountered: