Skip to content

Commit

Permalink
Merge pull request #985 from spack/fix-non-retryable-jobs-crashing
Browse files Browse the repository at this point in the history
Fix analytics webhook crash on non-retryable jobs
  • Loading branch information
mvandenburgh authored Oct 31, 2024
2 parents f1681ae + ab0f283 commit 5883529
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/custom_docker_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- docker-image: ./images/cache-indexer
image-tags: ghcr.io/spack/cache-indexer:0.0.3
- docker-image: ./analytics
image-tags: ghcr.io/spack/django:0.3.20
image-tags: ghcr.io/spack/django:0.3.21
- docker-image: ./images/ci-prune-buildcache
image-tags: ghcr.io/spack/ci-prune-buildcache:0.0.4
- docker-image: ./images/protected-publish
Expand Down
8 changes: 7 additions & 1 deletion analytics/analytics/core/job_failure_classifier/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@ def _job_retry_data(
retry_config = json.loads(job[0])

retry_max = retry_config["max"]
retry_reasons = retry_config["when"]
# A non-retryable job can either have an explicit max of zero, or no max at all.
# If the job is not retryable, the 'when' key will not exist
if retry_max in (0, None):
retry_reasons = []
# If the job is retryable, the 'when' key will be a list of reasons to retry
else:
retry_reasons = retry_config["when"]
# final_attempt is defined as an attempt that won't be retried for the retry_reasons
# or because it's gone beyond the max number of retries.
retryable_by_reason = (
Expand Down
4 changes: 2 additions & 2 deletions k8s/production/custom/webhook-handler/deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
serviceAccountName: webhook-handler
containers:
- name: webhook-handler
image: ghcr.io/spack/django:0.3.20
image: ghcr.io/spack/django:0.3.21
imagePullPolicy: Always
resources:
requests:
Expand Down Expand Up @@ -146,7 +146,7 @@ spec:
serviceAccountName: webhook-handler
containers:
- name: webhook-handler-worker
image: ghcr.io/spack/django:0.3.20
image: ghcr.io/spack/django:0.3.21
command:
[
"celery",
Expand Down

0 comments on commit 5883529

Please sign in to comment.