question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to set custom timeout duration?

See original GitHub issue

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

  1. Make a put request last more than 20 seconds.

Current behavior

The app crashes

ERROR aws.smithy.kotlin.runtime.http.engine.ktor.KtorEngine - throwing
java.util.concurrent.CancellationException: Timed out waiting for 20000 ms
	at aws.smithy.kotlin.runtime.http.engine.CoroutineUtilsKt$attachToOuterJob$cleanupHandler$1.invoke(CoroutineUtils.kt:39)
	at aws.smithy.kotlin.runtime.http.engine.CoroutineUtilsKt$attachToOuterJob$cleanupHandler$1.invoke(CoroutineUtils.kt:37)
	at kotlinx.coroutines.InvokeOnCancelling.invoke(JobSupport.kt:1457)

AWS Kotlin SDK version used

0.14.0-beta

Platform (JVM/JS/Native)

JVM

Operating System and version

Ubuntu 20.04.3 LTS

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
AlexandreBrowncommented, Apr 5, 2022

Thank you for investigating @aajtodd , I am pretty sure the json file we upload is much lighter than 500MB (maybe 25MB at most would be my guess) that being said it is in a highly concurrent environment therefore it might be that the request is not given high priority since we have a lot of coroutines running on the Dispatchers.IO.

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

1reaction
aajtoddcommented, Apr 5, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom Timeout Times - Discord Support
For example, the server I help moderate in handles moderation actions like this: - 2 hours - 6 hours - 12 hours -...
Read more >
Better Timeout Time - Discord Bot - Disforge
This bot allows you to set a timeout anywhere from 1 second to 28 days! This can be done via the /timeout length...
Read more >
Change Volley timeout duration - android - Stack Overflow
Volley sets default Socket & ConnectionTImeout to 5 secs for all requests. ... here you can write a custom retry policy and return...
Read more >
telnet command with custom timeout duration
Oracle enterprise linux. And this is for some big company. They won't easily allow to install new tools. Need to use some thing...
Read more >
Set Custom Timeout Property - VMware Docs
When vCenter is overloaded, it takes more time to return the response to the vRealize Orchestrator server than the 20000 milliseconds set by ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found