Skip to content

Commit ab92c70

Browse files
committed
timeout increase
1 parent 3230606 commit ab92c70

File tree

1 file changed

+5
-4
lines changed
  • services/director-v2/src/simcore_service_director_v2/api/routes

1 file changed

+5
-4
lines changed

services/director-v2/src/simcore_service_director_v2/api/routes/computations.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import contextlib
1919
import logging
20+
from datetime import timedelta
2021
from typing import Annotated, Any, Final
2122

2223
import networkx as nx
@@ -84,7 +85,7 @@
8485
from ..dependencies.rut_client import get_rut_client
8586
from .computations_tasks import analyze_pipeline
8687

87-
_PIPELINE_ABORT_TIMEOUT_S: Final[int] = 10
88+
_PIPELINE_ABORT_TIMEOUT_S: Final[timedelta] = timedelta(seconds=30)
8889

8990
_logger = logging.getLogger(__name__)
9091

@@ -121,7 +122,7 @@ async def _check_pipeline_startable(
121122
):
122123
raise HTTPException(
123124
status_code=status.HTTP_406_NOT_ACCEPTABLE,
124-
detail=f"Project {computation.project_id} cannot run since it contains deprecated tasks {jsonable_encoder( deprecated_tasks)}",
125+
detail=f"Project {computation.project_id} cannot run since it contains deprecated tasks {jsonable_encoder(deprecated_tasks)}",
125126
)
126127

127128

@@ -624,7 +625,7 @@ def return_last_value(retry_state: Any) -> Any:
624625
return retry_state.outcome.result()
625626

626627
@retry(
627-
stop=stop_after_delay(_PIPELINE_ABORT_TIMEOUT_S),
628+
stop=stop_after_delay(_PIPELINE_ABORT_TIMEOUT_S.total_seconds()),
628629
wait=wait_random(0, 2),
629630
retry_error_callback=return_last_value,
630631
retry=retry_if_result(lambda result: result is False),
@@ -643,7 +644,7 @@ async def check_pipeline_stopped() -> bool:
643644
# wait for the pipeline to be stopped
644645
if not await check_pipeline_stopped():
645646
_logger.error(
646-
"pipeline %s could not be stopped properly after %ss",
647+
"pipeline %s could not be stopped properly after %s",
647648
project_id,
648649
_PIPELINE_ABORT_TIMEOUT_S,
649650
)

0 commit comments

Comments
 (0)