Skip to content

Conversation

@MasterPtato
Copy link
Contributor

No description provided.

Copy link
Contributor Author

MasterPtato commented Jan 27, 2026


How to use the Graphite Merge Queue

Add the label merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 27, 2026

More templates

@rivetkit/virtual-websocket

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/virtual-websocket@4053

@rivetkit/cloudflare-workers

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/cloudflare-workers@4053

@rivetkit/db

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/db@4053

@rivetkit/framework-base

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/framework-base@4053

@rivetkit/next-js

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/next-js@4053

@rivetkit/react

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/react@4053

rivetkit

pnpm add https://pkg.pr.new/rivet-dev/rivet/rivetkit@4053

@rivetkit/sql-loader

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sql-loader@4053

@rivetkit/engine-runner

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner@4053

@rivetkit/engine-runner-protocol

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner-protocol@4053

commit: 93864b6

@claude
Copy link

claude bot commented Jan 27, 2026

PR Review: Fix active request calculation and add hibernating websocket metrics

Critical Issues

Compilation Error: Missing Function Definition

Location: engine/packages/pegboard-gateway/src/lib.rs:292

The function init_ns_metrics_exporter is called but never defined. This will cause a compilation failure.

Major Issues

Inconsistent Error Handling Pattern

Location: engine/packages/pegboard-gateway/src/lib.rs:619-700

The error handling for metrics has nested if-else blocks that could be flattened for better readability. When ingress metrics fail, the error is logged. When egress metrics fail, there is a nested condition that makes the code harder to follow.

Recommendation: Flatten the error handling so both metrics operations are independent.

Potential Data Accuracy Issue

Location: engine/packages/pegboard-gateway/src/lib.rs:624-632

Using size_hint() for request body size might not be accurate. The original code used body_bytes.len() which was accurate. This change means metrics might now be less accurate than before.

Code Quality Issues

Critical Bug Fix Without Explanation

Location: engine/packages/pegboard/src/workflows/actor/metrics.rs:67

Changed destroy from true to false. This is a critical logic change that fixes what appears to be a significant bug (actors were being incorrectly marked for destruction). This deserves better documentation and context in the PR description.

Unused Parameter Warning

Location: engine/packages/gasoline/src/db/kv/mod.rs:624

The worker_id parameter is prefixed with underscore but the change is not explained.

Test Coverage

No tests are included. This PR makes significant changes to metrics tracking logic. Consider adding unit tests for hibernating websocket metrics and integration tests verifying the destroy fix.

Summary

Must Fix:

  • Add the missing init_ns_metrics_exporter function definition

Should Fix:

  • The destroy = false bug fix needs better documentation
  • Inconsistent error handling pattern should be cleaned up
  • Consider the accuracy trade-off of using size_hint() vs actual body size

Consider:

  • Add tests for the metrics changes
  • Document the unused worker_id parameter
  • Add comments explaining backward compatibility fallbacks

@MasterPtato MasterPtato changed the base branch from 01-22-do_not_merge_add_metrics_exporter_for_ee to graphite-base/4053 January 29, 2026 01:27
@MasterPtato MasterPtato force-pushed the 01-27-fix_fix_active_req_caculation_add_hws_metrics branch from e4b540a to 93864b6 Compare January 29, 2026 01:27
@MasterPtato MasterPtato changed the base branch from graphite-base/4053 to main January 29, 2026 01:27
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