Skip to content

[CMGR-76557] fix: reconnect tail-log stream after EOF or transient error#723

Merged
angi-acs merged 1 commit into
adobe:mainfrom
GeorgeAlexandru:feat/CMGR-76557-tail-log-reconnect
Jun 12, 2026
Merged

[CMGR-76557] fix: reconnect tail-log stream after EOF or transient error#723
angi-acs merged 1 commit into
adobe:mainfrom
GeorgeAlexandru:feat/CMGR-76557-tail-log-reconnect

Conversation

@GeorgeAlexandru

Copy link
Copy Markdown

Summary

  • Adds a resilient while(true) reconnect loop in TailLog.tailLog() so the CLI never exits when the log stream ends
  • Swallows transient errors (no error.code: 404, network drops, Azure SAS URL expiry) and retries after a 2-second delay
  • Re-throws fatal CLI-coded errors (error.code set: MAX_RETRY_REACHED, NO_IMS_CONTEXT) so auth and config failures still surface correctly
  • Ctrl+C still exits immediately (SIGINT kills the process regardless of the loop)

Jira: https://jira.corp.adobe.com/browse/CMGR-76557
Root cause: executeWithRetries only retried on HTTP 401/403. EOF at midnight log rotation resolved normally — no error, no retry, silent CLI exit.

Test plan

  • New test: tail-log - reconnects after normal stream end — verifies sdk.tailLog called ≥2 times after EOF
  • New test: tail-log - retries silently on transient non-auth error — verifies 404 is swallowed and CLI stays alive
  • Updated test: tail-log - config — updated to not await runResult (loop never terminates); all 5 assertions still pass
  • Existing test: tail-log - should retry 5 times and throw error — unchanged, MAX_RETRY_REACHED (has error.code) still re-thrown correctly
  • Manual: run aio cloudmanager:tail-log before midnight UTC and confirm stream continues through rotation

🤖 Generated with Claude Code

Adds a resilient while-loop in TailLog.tailLog() that re-invokes sdk.tailLog()
after normal stream end (midnight UTC log rotation) or swallowable transient errors
(404, network drops, Azure SAS expiry). Fatal CLI-coded errors (MAX_RETRY_REACHED,
NO_IMS_CONTEXT) are re-thrown immediately. Reconnect delay is 2 seconds.

Fixes: https://jira.corp.adobe.com/browse/CMGR-76557

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@angi-acs angi-acs merged commit 402512d into adobe:main Jun 12, 2026
6 checks passed
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.

2 participants