SShortSingh.
Back to feed

Redis-py Bug Caused False Max Capacity Errors in Async Cluster Connections

0
·2 views

A bug in redis-py, the Python client for Redis, caused spurious MaxConnectionsError exceptions in asynchronous cluster setups despite connection capacity being available. The issue arose when a closed connection marked for reconnect was deferred to a background task, leaving a brief window where the pool appeared full to concurrent requests. During this single event-loop gap, any new acquire attempt would incorrectly find the free queue empty and the connection count at its limit. The fix, proposed in PR #4256 addressing issue #4247, ensures that already-closed connections skip the background disconnect task and immediately return their slot to the free pool. A deterministic regression test using asyncio.Event objects was also added to reproduce the exact race condition and verify the corrected behavior.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

How to add retry logic and rate limiting to a Node BFF with Alova

Node.js Backend-for-Frontend (BFF) services that proxy to downstream APIs can break when partners return 429 or 503 errors, exposing users to failures. A common manual retry approach introduces risks like retry storms, thundering herds, and inaccurate per-process counters in multi-instance deployments. The alova/server library addresses these issues through two dedicated hooks — retry and createRateLimiter — that attach resilience logic directly to request definitions. The retry hook supports configurable attempts, exponential backoff, and jitter to prevent synchronized retries across fleet instances. createRateLimiter tracks inbound request budgets by key such as IP or user ID, rejecting excess calls with a 429 before they ever reach the downstream service.

0
ProgrammingDEV Community ·

Developer Asks Community How People Store and Retrieve Personal Memories

A new member of the DEV Community has introduced themselves while working on a personal memory tool for consumers. They posed a question to fellow developers about how individuals typically store their personal thoughts and ideas. The user is also curious about the methods people use to retrieve that information when needed. The post reflects growing developer interest in personal knowledge management and memory-assist applications.

0
ProgrammingDEV Community ·

UCE-8 Proposal Aims to Encode All Living Scripts in Just Two Bytes

A new character encoding scheme called UCE-8 (Unicode Compact Encoding) has been proposed as an alternative to the widely used UTF-8 standard. While UTF-8 requires three bytes to represent most Asian and African language characters, UCE-8 aims to fit every currently spoken language into just two bytes. The scheme uses a three-tier structure: one byte for ASCII, two bytes for all living scripts, and three bytes for obsolete or rare code points. It achieves this by reorganizing 8,704 characters across 68 pages, covering world scripts, high-frequency Chinese characters, and common Korean syllables. The encoding is designed to be self-terminating and backward-compatible with ASCII, though it excludes certain control characters and punctuation marks from its two-byte trail byte range.

0
ProgrammingDEV Community ·

Alova lets developers add caching, retries and pagination to existing Axios setups

A developer guide published on DEV Community explains how the Alova request management library can be layered on top of an existing Axios instance without requiring a rewrite. Axios continues to handle the actual HTTP requests, while Alova manages higher-level concerns such as caching, request deduplication, pagination state, and automatic retries. The article highlights three common problems with plain Axios in React — unnecessary refetches on every component mount, race conditions during fast page switching, and no retry logic on transient errors. Using Alova's axiosRequestAdapter, developers can plug in their existing Axios instance, including its interceptors and baseURL configuration, with minimal code changes. The guide demonstrates that Alova's usePagination hook can replace manually managed loading, error, and page state across components.