Skip to content

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

Open
morgan-wowk wants to merge 1 commit intomasterfrom
reduce-status-checks
Open

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

Conversation

@morgan-wowk
Copy link

@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

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/b5cc879`

Copy link
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 2 times, most recently from 1b675e5 to 2398561 Compare March 5, 2026 22:28
@morgan-wowk morgan-wowk force-pushed the reduce-status-checks branch 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
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.

1 participant