You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If system time rolls back (ie it was incorrect and then set back to correct value) capacity will have negative value and delayMs can be potentially as big as time difference between lastTimestamp and current system time.
If time on device is wrong we can receive SignatureDoesNotMatch error from SQS and ask user to set time correctly. But when user changes time back there's no way to see that there's an issue as coroutine have got suspended and no exceptions being thrown.
Your Environment
Smithy Kotlin version - 0.17.0-beta
Operating system - Android 12
The text was updated successfully, but these errors were encountered:
iliasapsyrin
changed the title
When system time is incorrect del
When system time is incorrect and in the past coroutine can be suspended for a long period of time
Feb 20, 2023
The fix is merged to main and will be available in today's release (smithy-kotlin 0.16.0 consumed by aws-sdk-kotlin 0.21.0-beta).
Thank you very much @iliasapsyrin for the detailed report and the debugging you did to present the issue. It would've been a challenge to debug and reproduce this without your help!
Describe the bug
If system time rolls back (ie it was incorrect and then set back to correct value)
capacity
will have negative value anddelayMs
can be potentially as big as time difference betweenlastTimestamp
and current system time.https://github.com/awslabs/smithy-kotlin/blob/7babb8883133b35d2f81c6b51cebc3c03773775f/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/retries/delay/StandardRetryTokenBucket.kt#L67
Expected Behavior
Coroutine should not suspend longer than for
options.maxCapacity
.Current Behavior
Coroutine get suspended longer than for
options.maxCapacity
.Steps to Reproduce
SqsClient.createQueue()
. It should returnSignatureDoesNotMatch
errorSqsClient.createQueue()
. It will suspend for86335800
millisecondsPossible Solution
Wrap calculation of
refillMs
withabs
inStandardRetryTokenBucket
:Context
If time on device is wrong we can receive
SignatureDoesNotMatch
error from SQS and ask user to set time correctly. But when user changes time back there's no way to see that there's an issue as coroutine have got suspended and no exceptions being thrown.Your Environment
Smithy Kotlin version - 0.17.0-beta
Operating system - Android 12
The text was updated successfully, but these errors were encountered: