-
Notifications
You must be signed in to change notification settings - Fork 690
fix: etcd bucket delete missing prefix and metrics test range #3331
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
fix: etcd bucket delete missing prefix and metrics test range #3331
Conversation
WalkthroughTests in metrics.rs adjust expected NATS TOTAL_REQUESTS range. Etcd key-value store get/delete now construct keys via a shared make_key helper; delete adds tracing and uses the constructed key for kv_delete. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Caller
participant S as EtcdKeyValueStore
participant H as make_key(...)
participant E as Etcd Client
C->>S: delete(bucket, key)
S->>H: build namespaced key
H-->>S: constructed_key
S-->>S: trace!("deleting", constructed_key)
S->>E: kv_delete(constructed_key)
E-->>S: result
S-->>C: result
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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. Comment |
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.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
lib/runtime/src/metrics.rs(1 hunks)lib/runtime/src/storage/key_value_store/etcd.rs(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: trtllm
- GitHub Check: vllm
- GitHub Check: sglang
- GitHub Check: clippy (launch/dynamo-run)
- GitHub Check: tests (launch/dynamo-run)
- GitHub Check: clippy (lib/bindings/python)
- GitHub Check: clippy (.)
- GitHub Check: clippy (lib/runtime/examples)
- GitHub Check: tests (.)
- GitHub Check: tests (lib/runtime/examples)
- GitHub Check: tests (lib/bindings/python)
- GitHub Check: Build and Test - dynamo
🔇 Additional comments (3)
lib/runtime/src/metrics.rs (1)
1587-1589: LGTM! Test range adjustment addresses non-deterministic metrics.The change from requiring exactly 0.0 to accepting 0.0–10.0 for
TOTAL_REQUESTSis appropriate. The updated comment correctly notes that NATS service stats may differ from work handler counts due to timing and internal NATS behavior.lib/runtime/src/storage/key_value_store/etcd.rs (2)
73-73: Good consistency improvement.Aligning
get()to usemake_key()ensures all key operations consistently include the bucket prefix, matching the pattern already used increate(),update(),watch(), andentries().
239-241: Clean up orphaned test keys in etcdPrevious test runs created keys under the raw bucket prefix (
test_concurrent_bucket/...) before slugification. Remove any stale entries with etcdctl:# List keys under the old prefix etcdctl get test_concurrent_bucket --prefix --keys-only # Delete them etcdctl del test_concurrent_bucket --prefixThis ensures no leftover test keys remain before running the updated integration tests.
- Fix EtcdBucket::delete() to include bucket prefix using make_key() - Fix EtcdBucket::get() to use make_key() for consistency - Fix metrics test nats_service::TOTAL_REQUESTS expected range from 0-0 to 0-10 The delete() method was missing the bucket prefix, causing silent failures in test cleanup and accumulation of leftover keys in etcd. All bucket methods now consistently use make_key() for proper key construction. Signed-off-by: Keiven Chang <[email protected]>
aa6e28d to
3edd2f7
Compare
Signed-off-by: Keiven Chang <[email protected]>
Overview:
Details:
EtcdBucket::delete()to include bucket prefix viamake_key()- was silently failing due to missing prefixEtcdBucket::get()to usemake_key()for consistency with other methodsnats_service::TOTAL_REQUESTSinstead of requiring exactly 0Where should the reviewer start?
lib/runtime/src/storage/key_value_store/etcd.rs/coderabbit profile chill
Summary by CodeRabbit