Multinode - Rapidly build distributed cloud applications in Python | Product Hunt

Resource management


Functions, jobs and scheduled tasks are subject to timeouts, which can be configured using the timeout keyword argument.

import multinode as mn

def run_long_task():
    # your code

def run_very_long_job():
    # your code

The default timeouts are:

The maximum allowed timeout for a function, job or scheduled task is 1 day.

If a workload exceeds the timeout, a TimeoutError will be raised inside the code. You can catch it using try-except-finally blocks to terminate your computation gracefully.

import multinode as mn

def run_stuff():
        # Your code
    except TimeoutError:
        # e.g. log the timeout
        # Do some cleanup

The code will be forcibly killed if it doesn't finish within 5 minutes of the timeout.

Keep in mind that setting timeout=timedelta(hours=24) does not absolutely guarantee that your code will run uninterrupted for an entire day. Under exceptionally rare circumstances, your code may be interrupted due to hardware failures.