-
Notifications
You must be signed in to change notification settings - Fork 886
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9b3319b
to
798b1a2
Compare
798b1a2
to
624e367
Compare
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.
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.
👍
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]