Repository navigation
Retry a failed run report without waiting for another file (watcher 1.2.2) - #325
Merged
Merged
Conversation
Builds on the previous commit, which retries a run report that fails with a connection error or a server error. This commit limits the retries and tidies the code around them. - Stop after 16 retries (about 55 minutes), then send one `run_report_retries_exhausted` event. A new file in the run starts a fresh window, and so does a restart. - Send `run_report_failed` for the first failure of a window instead of every attempt. A 4xx is still sent every time, because it is not retried. - Remove the 429 and `Retry-After` handling. Data Hub never sends either to the watcher. - Count an unexpected error during a retry as a failed attempt. Before, it dropped the run from the retry list. - Keep the due times in one dictionary on `RunDetector`, name the delays in `constants.py`, and rename the monitor hook to `on_tick`. - Move the tests into `test_run_detector.py` and `test_monitor_events.py`. - Bump the watcher to 1.2.2, regenerate the CLI catalog and docs bundle, and add developer docs, a release table row, a troubleshooting section, and a changelog entry. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Retry at the 5-minute cap until the report goes through, instead of stopping after 16 retries. Remove MAX_RUN_REPORT_RETRIES and the run_report_retries_exhausted event. - Treat any error the client raises, not just ApiError, as a failed attempt on the first try as well as on retries. An error after the server accepted the report still propagates as before. - Keep the backoff when a new file arrives during an outage, so a run that keeps producing files records one run_report_failed event. - Clear the retry state after a 4xx. - Add ApiError.is_transient and use it in the uploader too. - Update docs, the changelog entry, and the MCP docs bundle. Co-authored-by: Cursor <cursoragent@cursor.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #245. Supersedes #246.
Problem
When the watcher's first report of a run to Data Hub fails because of a short connection problem, the run stays unreported until another file in that run finishes writing, or until the watcher restarts. A single-file run, or a run whose last file just finished, can wait for days. In automatic mode the file is not uploaded either.
What changed
The first commit is the fix from #246 by @RowletCC, with their authorship kept. It retries a failed report on the monitor's existing once-per-second loop, so no new file or restart is needed. The later commits tidy and extend it.
run_report_failedis recorded once for a row of retried failures, even if more files in the run finish during the outage, so a long outage doesn't fill the 500-event queue. A 4xx is still recorded every time. The heartbeat's error count still counts every attempt.Retry-Afterhandling from Retry transient watcher run reports without new file events #246. Data Hub never sends either to the watcher.ApiError.is_transientholds the "no response or 5xx" rule, and the uploader now uses it too.constants.py, the monitor hook is calledon_tick, and the tests live intest_run_detector.pyandtest_monitor_events.py.Replaying a report is safe: the server inserts a run only when its instrument and run ID are new, sends notifications only for new runs, and skips files it already has.
Release
uv.lock, the CLI catalog, and the docs bundle regenerated.watcher-v1.2.2and setting Latest version in Settings → Watchers happen after this reachesproduction.How I tested it
make checkpasses, which includesdocs-links.ApiErroron the first attempt, and restarting the backoff when a new file arrives.run_report_failedevent. I deleted the throwaway rows afterward. The last commit doesn't change that path.