- Notifications
You must be signed in to change notification settings - Fork928
fix: avoid missed logs when streaming startup logs#8029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
9b3319b
to798b1a2
Compare798b1a2
to624e367
CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It is a relatively large PR, but as long as it's consistent with other logs properties (Level, Output, CreatedAt), it is 👍 from me.
I will add, I'm not super happy with the DB change to facilitate the EOF. Ultimately I'd like to update the query to be like Open to alternatives. The main thing IMO is that we want the log fetching query to be able to signal EOF so that consumers know what's up. |
for { | ||
var logs []WorkspaceAgentStartupLog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This was a gnarly bug, had me scratching my head for a while 😬 (new test cases caught it)
I didn't like how I left some edge cases in the implementation, so I've tried to address those now with the last few commits.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
👍
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
I've been seeing inconsistent behavior with the startup log streaming and while looking at the implementation, I noticed a few issues:
With this refactor, we are not dependent on state from the pubsub and the agent tries to log an EOF at the end.
Thoughts:
Here's an image where the script has completed, but logs are missing (quite a lot of logs):

[test]