Closed jonathanwhang closed 3 months ago
The doubled values you are seeing seem to be an implementation detail of Java's Duration
class. When setting a timeout duration of 30ms, I can see the rawValue
field is 60000000, but the duration.inWholeMilliseconds
method returns the expected value of 30.
I'm also not able to replicate the issue you're having with timeouts not being respected. Setting socketReadTimeout
to 30 milliseconds consistently results in timeouts when I call DynamoDB ListTables operation.
Can you provide a detailed reproduction case? What are your timeout values, what operations are you invoking? As a sanity check, you can try setting a very low timeout to see if it is respected.
Hi @lauzadis, thanks for picking this up. Did a sanity check and confirmed that the configs do seem to work, it was just a misunderstanding on my part (timeout values needed to be lower). Closing this ticket.
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the bug
There's not much documentation surrounding how to configure a timeout on the Dynamo client using aws-sdk-kotlin outside of this page, which implies that HttpEngine properties, which include socketReadTimeout and socketWriteTimeout (see OkHttpEngineConfig) are configurable. What I currently have in my application is the following (using
aws.sdk.kotlin.services.dynamodb.DynamoDbClient
):However, it doesn't appear to be working at the moment as I'm still seeing dynamo operations surpassing 500ms.
There is one additional issue: accessing
DynamoDbClient.config.httpClient.config
shows double values for socketRead/WriteTimeout. For example, if I set socketReadTimeout to500.milliseconds
,httpClient.config
shows the int1,000,000,000
, which in nanoseconds is 1000ms). If I do an explicit get (DynamoDbClient.config.httpClient.config.socketReadTimeout
), I get the correct value I set in the form of a Duration.Docs/examples would be helpful.
Expected behavior
DynamoDBClient cancels operations that exceed the timeout configured in the HttpClient
Current behavior
No operations are cancelled, and the timeout values in the final config do not seem to reflect my inputs
Steps to Reproduce
Instantiate a DynamoDbClient using
DynamoDbClient.fromEnvironment { }
orDynamoDbClient { }
and set the timeout insidehttpClient
Possible Solution
No response
Context
No response
AWS SDK for Kotlin version
1.0.67
Platform (JVM/JS/Native)
JVM
Operating system and version
OS Sonoma