-
Notifications
You must be signed in to change notification settings - Fork 229
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
fix: Properly synchronize slog sender termination #11052
base: master
Are you sure you want to change the base?
Conversation
Deploying agoric-sdk with
|
Latest commit: |
80be157
|
Status: | ✅ Deploy successful! |
Preview URL: | https://dfd80380.agoric-sdk.pages.dev |
Branch Preview URL: | https://gibson-10925-followup.agoric-sdk.pages.dev |
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.
A few nits and a request for change on the handling of stdout close.
* @returns {F} the wrapped method | ||
*/ | ||
wrap(method, impl) { | ||
const wrappedMethods = /** @type {typeof methods} */ ( |
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.
Why not Methods
instead of typeof methods
?
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.
To allow for the increased specificity.
const waitForDrain = await written; | ||
if (waitForDrain) { | ||
await new Promise(resolve => stream.once('drain', resolve)); | ||
} |
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.
Yeah that's a little more respectful of the drain signal.
// @ts-expect-error calling a possibly missing method | ||
stream.close?.(); | ||
if (stream.end) { | ||
await new Promise(resolve => stream.end(() => resolve(undefined))); | ||
} |
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.
close
is only present on the fs WriteStream
, whereas end
also exists on the stdout stream, which we don't want to end. Is there any reason to change this one?
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 tried that in an early iteration and close
wasn't final enough, though I don't remember the details. I'm updating to exempt process.stdout
from this handling.
@mhofman back to you |
refs: #10925
Description
This was prompted by #10925 (comment) (calling out missing
level
data for kernel console slog entries), but more fundamentally fixes the interaction between cosmic-swingset, the kernel, and the telemetry system (and performs a few cleanups along the way).Security Considerations
Security posture should not be affected.
Scaling Considerations
None.
Documentation Considerations
n/a
Testing Considerations
Manual confirmation per #10776:
slog excerpt
Upgrade Considerations
This fixes a late-discovered flaw in #10925 and would ideally be cherry-picked into agoric-upgrade-19, but if it doesn't make it in then we'll just be missing the kernel console
level
data until agoric-upgrade-20 (which is still acceptable).Release verification should look for slog entries like the above (type "console", source "kernel", level "log"/"warn"/"error"/etc.).