BUG: Critical Scalability Flaw: In-Memory Session Storage Blocks Horizontal Scaling
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python, redis
調査の方向性
backend/app/services/auth/verification.py から始め、特に _verification_sessions のストレージとクリーンアップフローを確認してください。PR #174 で確立された Redis パターンと、issue で言及されている中央集約された app.core.redis 依存関係を確認してください。検証セッションが TTL 付きの共有 Redis ストレージを使用し、複数の worker またはレプリカ間でフローが機能すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Is there an existing issue for this?
- I have searched the existing issues
What happened?
Description: The authentication verification service currently relies on a global in-memory Python dictionary (_verification_sessions) to store active user sessions. This stateful architecture creates a critical blocker for production deployments that require horizontal scaling.
Location:
backend/app/services/auth/verification.py
(Line 11)
Technical Analysis: The application uses a module-level global variable for session management:
session_id -> (discord_id, expiry_time)
_verification_sessions: Dict[str, Tuple[str, datetime]] = {}
In a production environment utilizing WSGI/ASGI servers with multiple workers (e.g., gunicorn -w 4) or a container orchestration system (Kubernetes/Docker Swarm) with multiple replicas, this memory space is not shared.
The Failure Scenario:
User A initiates a verification flow and is handled by Worker 1, which stores the session in its local memory.
User A completes the OAuth flow and is redirected back to the callback endpoint.
The load balancer routes the callback request to Worker 2.
Worker 2 checks its own local memory, finds no record of the session, and rejects the request with "Session not found".
Impact:
Severity: Critical
Scalability: The application is forced to run as a single instance.
Reliability: Verification flows will fail intermittently in any multi-worker environment.
Proposed Solution: Refactor the session management to use a distributed cache store such as Redis.
Replace _verification_sessions with a Redis client wrapper.
Implement key-value storage with TTL (Time To Live) to handle expiry automatically (replacing the manual
_cleanup_expired_sessions
loop).
Ensure the Redis connection is initialized via a centralized dependency (app.core.redis).
Action Plan: I will invoke a PR to implement the Redis-based solution described above.
Related Issues:
PR #174 (Rate Limiting via Redis) - establishes a pattern but does not address this session storage flaw.
Issue #15 - Closed without resolution.
Record
- I want to work on this issue
- 主要言語
- Python
- スター
- 103
- フォーク
- 143
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AOSSIE-Org/Devr.AI のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
AOSSIE-Org/Devr.AI#315 · コメント 1 件 ·
-
Bump Weaviate image to 1.39.13 (Go 1.26.10 / CVE-2026-111943)対応中かも @dudanogueira が 38 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
AOSSIE-Org/Devr.AI#309 · コメント 1 件 ·
-
DOCS UPDATE: Incorrect Flask command path in backend installation guide対応中かも @Ashwin-Pillai-22 が 321 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
AOSSIE-Org/Devr.AI#229 · コメント 3 件 ·
-
BUG:Devr.AI Agent loses user_profile for returning users and fails to persist conversation summaries & cumulative interaction counts対応中かも @shubhumre777 が 34 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
AOSSIE-Org/Devr.AI#311 · コメント 2 件 ·
-
BUG: Local pytest suite fails to collect due to deprecated imports and mock schemas再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
AOSSIE-Org/Devr.AI#307 · コメント 1 件 ·
AOSSIE-Org/Devr.AI の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pimutils/vdirsyncer#1242 ·
-
priority:P2
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
QuantConnect/lean-cli#792 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
open-webui/open-webui#35360 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
Suggest link: Destiny Verify (MIT zero-dependency pre-commit security, citation & link hygiene CLI)オープン
難易度 1/5 1時間未満 初心者へのやさしさ 68/100