feat(datapoints): retry datapoint creation up to maxRetries#586
feat(datapoints): retry datapoint creation up to maxRetries#586RapidPoseidon wants to merge 1 commit into
Conversation
Previously a transient failure on the datapoint creation POST would fail the upload immediately. Wrap the call in the same retry loop already used by participant sample uploads: up to `rapidata_config.upload.maxRetries` attempts (default 3) with exponential backoff (1s, 2s, 4s) and suppressed intermediate logs. Co-Authored-By: luca <luca@rapidata.ai>
Code ReviewOverviewThis PR adds a retry loop with exponential backoff (1 s, 2 s, 4 s) around the Issues🔴 Retrying non-retryable (4xx) errorsThe # Suggested fix: skip retries for client errors
except Exception as e:
last_exception = e
is_client_error = (
isinstance(e, RapidataError)
and e.status_code is not None
and 400 <= e.status_code < 500
)
if attempt < max_retries - 1 and not is_client_error:
... # backoff and retry
else:
break # propagate immediatelyThe same issue exists in 🟡
|
Summary
The SDK previously failed a datapoint upload immediately on the first error from the create-datapoint POST. This wraps the call in a retry loop so transient failures (network blips, brief 5xx) no longer drop the datapoint.
rapidata_config.upload.maxRetriesattempts (default 3, already exposed via env/config).suppress_rapidata_error_loggingto avoid spamming users on retried errors; the final exception still propagates so the existing orchestrator-level failure tracking in_rapidata_dataset.pykeeps working.benchmark/participant/participant.py.Asset upload is left outside the retry loop — assets are uploaded ahead of time by the orchestrator and cached, so only the datapoint creation API call itself is the new retry surface.
Notes
pyright src/rapidata/rapidata_clientfrom the Poseidon container (Python tooling not present); please run it locally before merging as required by the repo's CLAUDE.md.Test plan
pyright src/rapidata/rapidata_clientclean.🔗 Session: https://session-e125c012.poseidon.rapidata.internal/