Uh oh!
There was an error while loading. Please reload this page.
fix(serverless): keep a log follow alive until the stream opens - #117
Conversation
Important Review skippedAuto reviews are disabled on this repository. To trigger a review, include ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Following an application that has not written a log entry yet ended by itself after about thirty seconds. The log store holds the tail request open without writing its response headers, so the edge times the request out before the first entry arrives, and any non-200 status on the tail route was fatal. A gateway status is now retryable: the follow reports it once and waits for the stream to open, the way it already waits after the server ends a stream. Nothing has been delivered when a gateway answers, so a reconnect cannot repeat an entry. Jira Ticket -> https://runware.atlassian.net/browse/RUNSERV-516
7cbe839 to
d68f98fCompareUh oh!
There was an error while loading. Please reload this page.
Jira Ticket -> https://runware.atlassian.net/browse/RUNSERV-516
What
runware serverless apps logs <appId> --followwaits for the live stream to open instead of exiting when a gateway answers first.Following an application that has not written a log entry yet ended by itself after about thirty seconds:
The log store holds the tail request open without writing its response headers, so the edge times the request out before the first entry arrives.
TailLogstreated any non-200 status on the tail route as fatal, so the follow ended on its own. A stream that has already carried one entry is unaffected and survives minutes of silence.A gateway status (502, 503, 504) on the tail route is now a
*TailUnavailableError, andfollowLogsreconnects on it the way it already reconnects after the server ends a stream. Nothing has been delivered when the gateway answers, so a reconnect cannot repeat an entry. Every other status stays fatal.The notice goes to stderr once per quiet spell rather than once per attempt: every attempt against a quiet application answers the same way, so a line every thirty-two seconds would be noise. A stream that opens resets it, so a later gateway answer is reported again.
Why
The acceptance criterion "
--followkeeps streaming until interrupted" did not hold for an application that is quiet at the moment you start the follow. QA on dev reproduced the exit four times out of four, between thirty-three and thirty-six seconds, on two different applications.curlon/v1/logs/queries/runtime_tail/tailreproduces it with no CLI involved:HTTP/2 504,server: cloudflare, after 30.5 seconds, sixteen bytes. On the same quiet application the command now holds for 160 seconds and exits 0 on Ctrl-C, and a busy application still streams unchanged.insightsshould also write its response headers when it accepts the connection, and that is the proper fix on the API side. This change means the CLI keeps its promise whichever way that goes, and it also covers an ordinary edge blip mid-follow.Notes
--followreconnects without a cap, as it already did for a stream the server ends. A permanently broken gateway therefore polls about every thirty-two seconds until interrupted.Provisioning: none.