Questions tagged [timeout]

The timeout term refers to a predefined period of time allowed to elapse before an event is to occur. Timeout may also refer to an event that takes place after a specified period of time elapses.

A timeout refers to both the process of defining, setting and controlling a predefined interval of time specifically related to executing a process when it has elapsed, as well as the process to execute itself.

A timeout may be cancelled, reset or reconfigured at any time, or allowed to run its course. Timeouts typically run once, although may be reused if the required functionality is required more than once.

In computing a timeout may be used to execute a predefined block of code after a specified amount of time, typically to throttle or control event flow or scope digest.

9712 questions
1068
votes
14 answers

How to dispatch a Redux action with a timeout?

I have an action that updates the notification state of my application. Usually, this notification will be an error or info of some sort. I need to then dispatch another action after 5 seconds that will return the notification state to the initial…
Ilja
  • 44,142
  • 92
  • 275
  • 498
866
votes
30 answers

How to sleep for five seconds in a batch file/cmd

Windows's Snipping tool can capture the screen, but sometimes I want to capture the screen after five seconds, such as taking an image being displayed by the webcam. (Run the script and smile at the camera, for example.) How do I sleep for 5 seconds…
nonopolarity
  • 146,324
  • 131
  • 460
  • 740
685
votes
8 answers

Android error: Failed to install *.apk on device *: timeout

I'm getting this error from time to time and don't know what causing this: When trying to run/debug an Android app on a real device (Galaxy Samsung S in my case) I'm getting the following error in the Console: Failed to install *.apk on device *:…
Arye Rosenstein
  • 4,246
  • 3
  • 18
  • 15
500
votes
24 answers

Timeout on a function call

I'm calling a function in Python which I know may stall and force me to restart the script. How do I call the function or what do I wrap it in so that if it takes longer than 5 seconds the script cancels it and does something else?
Teifion
  • 108,121
  • 75
  • 161
  • 195
407
votes
26 answers

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated

I have many users on my web site (20000-60000 per day), which is a download site for mobile files. I have remote access to my server (windows server 2008-R2). I've received "Server is unavailable" errors before, but I am now seeing a connection…
SilverLight
  • 19,668
  • 65
  • 192
  • 300
383
votes
32 answers

Using module 'subprocess' with timeout

Here's the Python code to run an arbitrary command returning its stdout data, or raise an exception on non-zero exit codes: proc = subprocess.Popen( cmd, stderr=subprocess.STDOUT, # Merge stdout and stderr stdout=subprocess.PIPE, …
Sridhar Ratnakumar
  • 81,433
  • 63
  • 146
  • 187
374
votes
24 answers

Timeout a command in bash without unnecessary delay

This answer to Command line command to auto-kill a command after a certain amount of time proposes a 1-line method to timeout a long-running command from the bash command line: ( /path/to/slow command with options ) & sleep 5 ; kill $! But it's…
system PAUSE
  • 37,082
  • 20
  • 62
  • 59
337
votes
10 answers

How to set HttpResponse timeout for Android in Java

I have created the following function for checking the connection status: private void checkConnectionStatus() { HttpClient httpClient = new DefaultHttpClient(); try { String url = "http://xxx.xxx.xxx.xxx:8000/GaitLink/" …
Niko Gamulin
  • 66,025
  • 95
  • 221
  • 286
321
votes
22 answers

Timeout for python requests.get entire response

I'm gathering statistics on a list of websites and I'm using requests for it for simplicity. Here is my code: data=[] websites=['http://google.com', 'http://bbc.co.uk'] for w in websites: r= requests.get(w, verify=False) data.append( (r.url,…
Kiarash
  • 7,378
  • 10
  • 44
  • 69
282
votes
18 answers

How to timeout a thread

I want to run a thread for some fixed amount of time. If it is not completed within that time, I want to either kill it, throw some exception, or handle it in some way. How can it be done? One way of doing it as I figured out from this thread is to…
java_geek
  • 17,585
  • 30
  • 91
  • 113
274
votes
7 answers

Setting Curl's Timeout in PHP

I'm running a curl request on an eXist database through php. The dataset is very large, and as a result, the database consistently takes a long amount of time to return an XML response. To fix that, we set up a curl request, with what is supposed to…
Moki
  • 5,121
  • 4
  • 21
  • 9
263
votes
8 answers

How to set ssh timeout?

I'm executing a script connecting via password-less SSH on a remote host. I want to set a timeout, so that if the remote host is taking an infinite time to run, I want to come out of that ssh session and continue other lines in my sh script. How can…
user57421
  • 7,091
  • 7
  • 25
  • 22
236
votes
2 answers

What is the difference between connection and read timeout for sockets?

3 questions: What is the difference between connection and read timeout for sockets? What does connection timeout set to "infinity" mean? In what situation can it remain in an infinitive loop? and what can trigger that the infinity-loop dies? What…
corgrath
  • 11,673
  • 15
  • 68
  • 99
225
votes
17 answers

NGINX: upstream timed out (110: Connection timed out) while reading response header from upstream

I have Puma running as the upstream app server and Riak as my background db cluster. When I send a request that map-reduces a chunk of data for about 25K users and returns it from Riak to the app, I get an error in the Nginx log: upstream timed out…
user2768537
  • 2,251
  • 2
  • 12
  • 4
214
votes
10 answers

How to set timeout in Retrofit library?

I am using Retrofit library in my app, and I'd like to set a timeout of 60 seconds. Does Retrofit have some way to do this? I set Retrofit this way: RestAdapter restAdapter = new RestAdapter.Builder() .setServer(BuildConfig.BASE_URL) …
androidevil
  • 9,011
  • 14
  • 41
  • 79
1
2 3
99 100