Skip to content

Commit

Permalink
Add logging of call failures
Browse files Browse the repository at this point in the history
  • Loading branch information
jscheffl committed Dec 21, 2024
1 parent bc430d8 commit 71c8b0c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion task_sdk/src/airflow/sdk/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from __future__ import annotations

import logging
import os
import sys
import uuid
Expand All @@ -28,7 +29,7 @@
import structlog
from pydantic import BaseModel
from retryhttp import retry, wait_retry_after
from tenacity import wait_random_exponential
from tenacity import before_log, wait_random_exponential
from uuid6 import uuid7

from airflow.sdk import __version__
Expand Down Expand Up @@ -304,6 +305,7 @@ def __init__(self, *, base_url: str | None, dry_run: bool = False, token: str, *
wait_network_errors=_default_wait,
wait_timeouts=_default_wait,
wait_rate_limited=wait_retry_after(fallback=_default_wait), # No infinite timeout on HTTP 429
before_sleep=before_log(log, logging.WARNING),
)
def request(self, *args, **kwargs):
"""Implement a convenience for httpx.Client.request with a retry layer."""
Expand Down

0 comments on commit 71c8b0c

Please sign in to comment.