Skip to content

prevent tokio runtime queue overload under high load#154

Open
ruslanti wants to merge 2 commits into
mainfrom
fix/prevent-tokio-runtime-queue-overload-under-high-load
Open

prevent tokio runtime queue overload under high load#154
ruslanti wants to merge 2 commits into
mainfrom
fix/prevent-tokio-runtime-queue-overload-under-high-load

Conversation

@ruslanti

Copy link
Copy Markdown
Collaborator

No description provided.

@ruslanti ruslanti self-assigned this Jul 10, 2026
Copilot AI review requested due to automatic review settings July 10, 2026 12:34
@ruslanti ruslanti changed the title Fix/prevent tokio runtime queue overload under high load prevent tokio runtime queue overload under high load Jul 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to reduce request backpressure under load by (1) adding more granular failure classifications for metrics and (2) making Redis (KV-store) operations fail fast so slow/unreachable Redis doesn’t stall tasks and allow in-flight work to pile up.

Changes:

  • Extend AppResult/metrics labeling with new outcomes (OVERLOADED, RATE_LIMITED, DISABLED) for clearer error reason breakdown in Prometheus.
  • Configure Redis ConnectionManager with explicit short timeouts/retry/backoff to avoid long stalls on the request hot path.
  • Adjust tracing instrumentation and Redis warning log fields.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
crates/runtime/src/util/metrics.rs Adds new AppResult → Prometheus “reason” label mappings.
crates/runtime/src/lib.rs Introduces new AppResult variants (behind metrics feature) to represent overload/rate-limit/disabled outcomes.
crates/key-value-store/src/redis_impl.rs Switches to ConnectionManagerConfig with explicit fail-fast timeouts and updates warning logs.
crates/key-value-store/src/lib.rs Removes err from #[instrument(...)] on KV host methods (keeps ret).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/key-value-store/src/redis_impl.rs
Comment thread crates/key-value-store/src/redis_impl.rs
Comment thread crates/key-value-store/src/redis_impl.rs
Comment thread crates/key-value-store/src/redis_impl.rs
Comment thread crates/key-value-store/src/redis_impl.rs
Comment thread crates/key-value-store/src/redis_impl.rs
Comment on lines 116 to 119
.map_err(|error| {
tracing::warn!(cause=?error, "redis bf_exists");
tracing::warn!(cause = ?error, key, item, "kv-store: redis bf_exists");
Error::InternalError
})
@ruslanti ruslanti requested a review from qrdl July 10, 2026 12:41
@ruslanti ruslanti added the enhancement New feature or request label Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants