Skip to content

feat: log memory usage and shutdown#207

Open
shoom3301 wants to merge 2 commits into
mainfrom
shoom3301-patch-1
Open

feat: log memory usage and shutdown#207
shoom3301 wants to merge 2 commits into
mainfrom
shoom3301-patch-1

Conversation

@shoom3301

@shoom3301 shoom3301 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor
  1. Add a SIGTERM handler (mirroring the SIGINT one). Next time it will log a clean shutdown on any k8s-initiated restart, so silence will then unambiguously mean SIGKILL/OOM. Right now the two cases are indistinguishable.
  2. Periodically log memory usage to see when OOM happens

Added memory usage logging and graceful shutdown handling.
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@shoom3301, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 5 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 90ec2adc-790a-43ab-b890-cae9f8f3c166

📥 Commits

Reviewing files that changed from the base of the PR and between c5b0000 and 93eb12d.

📒 Files selected for processing (1)
  • src/commands/run.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch shoom3301-patch-1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Moved the formatMemoryUsage function into run.ts to consolidate memory logging functionality.
@shoom3301 shoom3301 self-assigned this Jul 22, 2026
@shoom3301
shoom3301 requested a review from a team July 22, 2026 18:03
Comment thread src/commands/run.ts
// How often to log the process memory usage. This leaves a memory trail in the
// logs so a restart can be correlated with memory pressure (e.g. OOM) even when
// only the application logs are available.
const MEMORY_LOG_FREQUENCY_SECS = 60;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: I think it's actually is a period or interval then frequency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants