fix: prevent infinite polling loop when deployment status is error#224
Open
codxbrexx wants to merge 1 commit intometacall:masterfrom
Open
fix: prevent infinite polling loop when deployment status is error#224codxbrexx wants to merge 1 commit intometacall:masterfrom
codxbrexx wants to merge 1 commit intometacall:masterfrom
Conversation
… fail - Replace single 'ready' status check with terminal states array: ['ready', 'error', 'fail'] - Change loop condition from 'status !== ready' to '!TERMINAL_STATES.includes(status)' - Add MAX_POLL_ATTEMPTS protection (360 attempts = 1 hour at 10s intervals) as timeout safety net - Exit with code 1 and appropriate error messages for 'error' and 'fail' states - Increment poll attempts counter to track and limit polling iterations - Previously, deployments reaching error state would cause infinite polling and CLI hang Fixes: ISSUE metacall#223 - logs polling never ends on error status Test Coverage: - 17 unit tests covering terminal states, max attempts, polling behavior - Tests for error recovery and log output handling - All tests passing
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.
Fix Infinite Logs Polling Loop
Fixes: #223
Problem
CLI hangs indefinitely when deployment status reaches
errororfailstate because polling loop only checks forreadystatus.Solution
['ready', 'error', 'fail']Changes
src/logs.ts: Replace single status check with terminal states arraysrc/test/logs.spec.ts: Add 17 unit tests for polling behaviorImpact
Tests