Skip to content

Commit d39afc3

Browse files
committed
Shorter timeout and no retry for auth and transform ID value error
1 parent cfeca26 commit d39afc3

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

servicex/servicex_adapter.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import httpx
3333
from aiohttp_retry import RetryClient, ExponentialRetry
3434
from google.auth import jwt
35-
from tenacity import AsyncRetrying, stop_after_attempt, wait_fixed
35+
from tenacity import AsyncRetrying, stop_after_attempt, wait_fixed, retry_if_not_exception_type
3636

3737
from servicex.models import TransformRequest, TransformStatus
3838

@@ -132,10 +132,15 @@ async def submit_transform(self, transform_request: TransformRequest):
132132

133133
async def get_transform_status(self, request_id: str) -> TransformStatus:
134134
headers = await self._get_authorization()
135-
retry_options = ExponentialRetry(attempts=5, start_timeout=10)
135+
retry_options = ExponentialRetry(attempts=5, start_timeout=3)
136136
async with RetryClient(retry_options=retry_options) as client:
137137
try:
138-
async for attempt in AsyncRetrying(stop=stop_after_attempt(5),
138+
async for attempt in AsyncRetrying(retry=retry_if_not_exception_type
139+
(
140+
AuthorizationError,
141+
ValueError
142+
),
143+
stop=stop_after_attempt(3),
139144
wait=wait_fixed(3),
140145
reraise=True):
141146
with attempt:

0 commit comments

Comments
 (0)