DiamondLightSource / DiamondLightSource/heliotrapi

analysis_fn should have a configurable timeout.

Open
#37 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Currently analysis functions will wait forever or until finished.

we should do something like, and analysis_fn should have a configurable timeout.

result_value = await asyncio.wait_for(
analysis_fn(**converted_inputs),
timeout=job.timeout_seconds, # or a configured default
)

It should be long enough that any reasonable functions should finish, but not so long it locks for a very long time.

Something like 1200 seconds, but this depends on https://github.com/DiamondLightSource/heliotrapi/issues/36

Contributor guide

Open the contributing guide

Research direction

Start by locating where analysis_fn is executed and how job.timeout_seconds or a configured default could be supplied. Review the dependency on issue #36 before deciding the timeout source and behavior, then identify or add tests that verify analysis functions stop after the configured limit and complete normally before it.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.