-
-
Notifications
You must be signed in to change notification settings - Fork 80
Implement non-buffered streaming for step logs #438
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
Now that the log-index is read incrementally while streaming, the length of the step log needs to be determined before returning. The only option for determining the step logs length is by reading the full index file. A new IndexReader class abstracts the parsing of the index. It is used by both the full read in advance and the incremental read while streaming the log content.
jglick
left a comment
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.
Looks OK. Did not follow all of it.
| while (readNext(next)) { | ||
| stepLogSize += (next.end - next.start); | ||
| } |
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.
Does not seem particularly efficient, but I guess it can be optimized later as needed.
| // LargeText also needs to be improved to support opaque (non-long) cursors | ||
| // (and callers such as progressiveText.jelly and Blue Ocean updated accordingly), | ||
| // which is a hard requirement for efficient rendering of cloud-backed logs, |
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.
Still true I think. (Blue Ocean is moribund, but the same comment potentially applies to anything rendering JEP-210-based logs.) OTOH there has been no recent development in this area; CloudBees does maintain a cloud-backed log storage, but largely using private API contracts.
dwnusbaum
left a comment
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.
Looks ok! I did not try to test it.
src/main/java/org/jenkinsci/plugins/workflow/log/FileLogStorage.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Devin Nusbaum <[email protected]>
|
jenkinsci/jenkins#11071 has been merged and included in Jenkins core |
jglick
left a comment
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.
OK AFAICT
|
Would like to test it against CloudBees CI and |
|
Actually |
|
Thanks for the reviews and merging it! Would you mind creating a new release to make it available in pipeline-graph-view-plugin? |
|
Release failed due to expired tokens: I've re-triggered it, tokens are 2 hours old so should be fine currently |
Instead of reading the entire step log into memory before emitting parts of it, this PR is implementing streaming based reading for step logs.
Now that the log-index is read incrementally while streaming, the length
of the step log needs to be determined before returning. The only option
for determining the step logs length is by reading the full index file.
A new IndexReader class abstracts the parsing of the index. It is used
by both the full read in advance and the incremental read while
streaming the log content.
Testing done
Previous PRs have added good coverage for the happy paths and edge cases when reading the index.
Submitter checklist