fix(cloud-task): Load run history from presigned log URLs#3489
Closed
charlesvien wants to merge 3 commits into
Closed
fix(cloud-task): Load run history from presigned log URLs#3489charlesvien wants to merge 3 commits into
charlesvien wants to merge 3 commits into
Conversation
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
2 tasks
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Member
Author
Contributor
|
Reviews (1): Last reviewed commit: "load cloud run history from presigned lo..." | Re-trigger Greptile |
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.
Problem
Opening a cloud task with a large history can fail permanently with "Failed to load cloud run history". The bootstrap pages through the
session_logs/API, where every page makes the server re-read and re-parse the run's entire log chain from S3. On big runs a single page exceeds the 30s defaultauthenticatedFetchtimeout, and since the bootstrap is all-or-nothing and Retry restarts at offset 0, the thread becomes unopenable while the run itself is still healthy.Changes
log_urlsthat the run detail API now returns (feat(tasks): expose resume-chain presigned log urls on run detail posthog#71394), parsing the JSONL client-side. This removes Django from the history byte path entirely and works for any history size. Falls back to the paginated API on old servers or when a download fails.log_urlfallback, with the page timeout raised from 10s to 120s.How did you test this?
Added Vitest cases in
cloud-task.test.ts: bootstrap from chain URLs (including a final line without trailing newline) without touchingsession_logs, fallback to the paginated API when a chain download fails, and resume from the last fetched page after a watcher retry. Ran the full@posthog/coresuite (2283 tests) and the mobile suite (429 tests), pluspnpm --filter @posthog/core typecheckand Biome on the changed packages. I did not manually test against a live run; the server-side PR needs to be deployed for the chain path to activate.Automatic notifications