Project

General

Profile

Bug #194

Fix timeout handling on the appscale tools side

Added by Tanvi Marballi over 2 years ago. Updated 8 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
% Done:

0%

Estimated Time:
Deployment type:
AppScale - self deployed

Description

Figure out whether the raise exception at the end of this timeout logic in the appcontroller client works or it needs to be changed.

def timeout_handler(, _):
"""Raises a TimeoutException if the function we want to execute takes
too long to run.

Raises:
TimeoutException: If a SIGALRM is raised.
"""
raise TimeoutException()
signal.signal(signal.SIGALRM, timeout_handler)
signal.alarm(timeout_time) # trigger alarm in timeout_time seconds
try:
retval = function(*args)
except TimeoutException:
return default
except socket.error as exception:
signal.alarm(0) # turn off the alarm before we retry
if num_retries > 0:
time.sleep(1)
return self.run_with_timeout(timeout_time, default, num_retries - 1,
function, *args)
else:
raise exception

History

#1 Updated by Steven Graham 8 months ago

  • Target version set to backlog

Also available in: Atom PDF