Skip to content

Commit

Permalink
Issue #128 increase timeout on getting batch job logs
Browse files Browse the repository at this point in the history
  • Loading branch information
soxofaan committed Oct 20, 2023
1 parent 8f3b51f commit 0c4dfbf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The format is roughly based on [Keep a Changelog](https://keepachangelog.com/en/

- Dockerfile: switch to `python:3.9-slim-bullseye` base image
- Parallelize `/jobs` requests to upstream back-ends ([#28](https://github.com/Open-EO/openeo-aggregator/issues/28))
- Increase timeout on getting batch job logs to 120s ([#128](https://github.com/Open-EO/openeo-aggregator/issues/128))

### Fixed

Expand Down
6 changes: 5 additions & 1 deletion src/openeo_aggregator/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import openeo_aggregator.egi
from openeo_aggregator.caching import Memoizer, json_serde, memoizer_from_config
from openeo_aggregator.config import (
CONNECTION_TIMEOUT_JOB_LOGS,
CONNECTION_TIMEOUT_JOB_START,
CONNECTION_TIMEOUT_RESULT,
AggregatorConfig,
Expand Down Expand Up @@ -888,8 +889,11 @@ def get_log_entries(
level: Optional[str] = None,
) -> Iterable[dict]:
con, backend_job_id = self._get_connection_and_backend_job_id(aggregator_job_id=job_id)
# Use parenthesized context managers, see #127
with con.authenticated_from_request(request=flask.request, user=User(user_id)), \
self._translate_job_errors(job_id=job_id):
self._translate_job_errors(job_id=job_id), \
con.override(default_timeout=CONNECTION_TIMEOUT_JOB_LOGS), \
TimingLogger(title=f"Get log entries for {job_id}", logger=_log.debug):
return con.job(backend_job_id).logs(offset=offset, level=level)


Expand Down
1 change: 1 addition & 0 deletions src/openeo_aggregator/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
CONNECTION_TIMEOUT_INIT = 12.5
CONNECTION_TIMEOUT_RESULT = 15 * 60
CONNECTION_TIMEOUT_JOB_START = 5 * 60
CONNECTION_TIMEOUT_JOB_LOGS = 2 * 60

STREAM_CHUNK_SIZE_DEFAULT = 10 * 1024

Expand Down

0 comments on commit 0c4dfbf

Please sign in to comment.