Skip to content

chore: Prevent unnecessary API calls to get container execution details#1893

Merged
morgan-wowk merged 1 commit intomasterfrom
reduce-status-checks
Mar 31, 2026
Merged

chore: Prevent unnecessary API calls to get container execution details#1893
morgan-wowk merged 1 commit intomasterfrom
reduce-status-checks

Conversation

@morgan-wowk
Copy link
Copy Markdown

@morgan-wowk morgan-wowk commented Mar 4, 2026

Description

Before

image.png

After

image.png

Optimized container execution state and log fetching by preventing unnecessary API calls for containers in expected non-execution states. Added status-based conditional fetching that skips requests when containers are in states like INVALID, UNINITIALIZED, QUEUED, WAITING_FOR_UPSTREAM, or SKIPPED, where execution records and logs are not expected to exist. Refined log polling logic to only poll for actively running containers (RUNNING, PENDING, CANCELLING) while still allowing log fetches for completed states that may have logs.

Related Issue and Pull requests

Type of Change

  • Improvement

Checklist

  • I have tested this does not break current pipelines / runs functionality

Screenshots (if applicable)

Test Instructions

  1. Navigate to task details for containers with statuses: INVALID, UNINITIALIZED, QUEUED, WAITING_FOR_UPSTREAM, or SKIPPED
  2. Verify that no container execution state or log API calls are made for these statuses
  3. Confirm that containers with RUNNING, PENDING, or CANCELLING statuses actively poll for logs every 5 seconds
  4. Test that completed containers (SUCCEEDED, FAILED, SYSTEM_ERROR, CANCELLED) fetch logs once without polling
  5. Verify that the ExecutionDetails and Logs components still render correctly for all status types

Additional Comments

This change reduces unnecessary network requests and prevents potential errors when trying to fetch execution state or logs for containers that haven't been launched or were terminated before execution began. The CANCELLED status is intentionally handled carefully since tasks cancelled mid-run may have logs uploaded by the backend before termination.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 4, 2026

🎩 To tophat this PR:

You can add the following URL parameter to your browser to tophat this PR:

`?tophat_location=reduce-status-checks/e0cc8ea`

Copy link
Copy Markdown
Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@morgan-wowk morgan-wowk self-assigned this Mar 4, 2026
@morgan-wowk morgan-wowk force-pushed the reduce-status-checks branch from b351afd to 92e9cbb Compare March 4, 2026 19:51
@morgan-wowk morgan-wowk marked this pull request as ready for review March 5, 2026 22:03
@morgan-wowk morgan-wowk requested a review from a team as a code owner March 5, 2026 22:03
@morgan-wowk morgan-wowk force-pushed the reduce-status-checks branch 3 times, most recently from 2398561 to b5cc879 Compare March 5, 2026 22:33
@morgan-wowk morgan-wowk changed the title chore: Prevent unnecessary API calls to get container details chore: Prevent unnecessary API calls to get container execution details Mar 5, 2026
@morgan-wowk morgan-wowk force-pushed the reduce-status-checks branch from b5cc879 to 7f33348 Compare March 5, 2026 22:48
Copy link
Copy Markdown
Author

I have updated this to respect that Cancelled might have some start and end time, or logs. So we will still request information for cancelled states to account for mid-run cancellations.

@morgan-wowk morgan-wowk force-pushed the reduce-status-checks branch from 7f33348 to d0d58ef Compare March 5, 2026 22:53
Copy link
Copy Markdown
Collaborator

maxy-shpfy commented Mar 6, 2026

I tophatted and seems no regression, works as intended - will take another look soon

Copy link
Copy Markdown
Author

@maxy-shpfy Just a friendly nudge. No rush. Still a desired change.

Copy link
Copy Markdown
Collaborator

@camielvs camielvs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appears to be working

Copy link
Copy Markdown
Author

morgan-wowk commented Mar 31, 2026

Merge activity

  • Mar 31, 6:09 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Mar 31, 6:10 PM UTC: Graphite rebased this pull request as part of a merge.
  • Mar 31, 6:12 PM UTC: @morgan-wowk merged this pull request with Graphite.

@morgan-wowk morgan-wowk force-pushed the reduce-status-checks branch from d0d58ef to e0cc8ea Compare March 31, 2026 18:10
@morgan-wowk morgan-wowk merged commit 2dbe639 into master Mar 31, 2026
17 checks passed
@morgan-wowk morgan-wowk deleted the reduce-status-checks branch March 31, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants