-
Notifications
You must be signed in to change notification settings - Fork 233
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
feat: use xsnap worker CPU meter and start reporting consumption #2384
Conversation
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'm hesitant to move forward with -DmxMetering=1
while Moddable considers it experimental. I'd like to hear from @dtribble on that, but presuming you're already in communication with him about it, I approve.
I'd really rather not have any
in the type annotations, but I don't suppose that's critical.
packages/SwingSet/src/kernel/vatManager/manager-subprocess-xsnap.js
Outdated
Show resolved
Hide resolved
packages/SwingSet/src/kernel/vatManager/manager-subprocess-xsnap.js
Outdated
Show resolved
Hide resolved
8b64ebf
to
0b177df
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.
I think I should withdraw my approval until we have clarity on @warner 's question:
shouldn't the meterStats be part of the OK that comes back from the worker?
Need another pass due to important changes.
8b581db
to
b418db5
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.
I was about to approve this, but then ava hangs when I yarn test
because some xsnap process is hanging around.
diagnosis: How did this get thru ci? eek! |
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.
makefiles/lin/xsnap.mk
is missing -DmxMetering=1
and the test-quick ci job is missing packages/xsnap
altogether!
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.
Tentative approval, please check the comments and see if the recommended changes are ones you're comfortable with. The XSNAP_VERSION thing is the one I'm most concerned about. The message-result protocol is the one I thought the most about but it might not be worth doing anything about.
I've added preflight checks to xsnap.c to reject metering unless
Added! |
Refs #2322
We implement the same basic policy as in the local worker: refill the meter with a constant value (
1e7
computrons) before every crank and terminate the vat if it consumes more than that in a crank.There is still a long way to go, but at least now we detect and terminate an xsnap vat upon infinite loops.