-
Notifications
You must be signed in to change notification settings - Fork 47.3k
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
[Scheduler] Prevent event log from growing unbounded #16781
Conversation
If a Scheduler profile runs without stopping, the event log will grow unbounded. Eventually it will run out of memory and the VM will throw an error. To prevent this from happening, let's automatically stop the profiler once the log exceeds a certain limit. We'll also print a warning with advice to call `stopLoggingProfilingEvents` explicitly.
); | ||
eventLogSize *= 2; | ||
if (eventLogSize > MAX_EVENT_LOG_SIZE) { | ||
console.error( |
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 message will increase the size of the profiling build. Seems fine? Idk.
: MAX_TEST_ITERATIONS; | ||
const maxIterations = t.logicalExpression( | ||
'||', | ||
t.memberExpression( |
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.
@gaearon Might want to review the changes I made in here. I wanted to increase the limit for a specific test so I could trigger the memory error.
8fe678d
to
1f55c5a
Compare
Details of bundled changes.Comparing: 87eaa90...1f55c5a react
scheduler
|
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 don't like this test. :) It's unnecessarily slow and binds us to this particular variant of infinite loop tracking.
Ok I'm going to land as-is though because I don't have any better ideas for how to test it right now, and I'd rather have a slow test than no test |
If a Scheduler profile runs without stopping, the event log will grow unbounded. Eventually it will run out of memory and the VM will throw an error.
To prevent this from happening, let's automatically stop the profiler once the log exceeds a certain limit. We'll also print a warning with advice to call
stopLoggingProfilingEvents
explicitly.