-
Notifications
You must be signed in to change notification settings - Fork 748
fix(childprocess): noisy "memory threshold" logs #7017
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
Problem:
"memory threshold" message logged multiple times for a the same PID:
2025-04-11 ... Process 23662 exceeded memory threshold: 506986496
2025-04-11 ... Process 23662 exceeded memory threshold: 507019264
2025-04-11 ... Process 23662 exceeded memory threshold: 507052032
2025-04-11 ... Process 23662 exceeded memory threshold: 507084800
This is noisy in the logs.
Solution:
Only log "memory threshold" once per PID.
|
| cpu: 50, | ||
| } | ||
| static readonly logger = logger.getLogger('childProcess') | ||
| static readonly #loggedPids = new CircularBuffer(1000) |
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.
Are we concerned about the case where a child process has a problem (ex. memory leak) that causes it to increase its resource usage as time passes? This change would make it hard to catch that.
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.
That's a valid concern, but:
- by this point the "threshold" was already exceeded, which means we presumably already reached an alarm-state
- to give visibility into "growing"/leak behavior, we should enhance the logic rather than hoping that someone will puzzle it out through these logs
|
This test aws-toolkit-vscode/packages/core/src/test/shared/utilities/processUtils.test.ts Lines 448 to 471 in f1dded7
Otherwise LGTM! |
That's probably better. For now I just clear() the circularbuffer in beforeEach. |
|
/runintegrationtests |
Problem
"memory threshold" message logged multiple times for a the same PID:
This is noisy in the logs.
Solution
Only log "memory threshold" once per PID.
feature/xbranches will not be squash-merged at release time.