Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Connection pool ergonomics: timeouts, idle/lifetime caps, sync pool

オープン
#67 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
rust
領域
backend, databases

調査の方向性

Start with hyperdb-api/src/pool.rs and §6 of docs/RUST_API_GAP_ANALYSIS.md to map the existing async pool and PoolConfig surface. Define the additive timeout, lifetime, idle, min-idle, and recycle options, then assess the sync ConnectionPool boundary and its lack of a Tokio dependency. Done means the listed options and sync pool are implemented with current defaults preserved, with tests covering timeout, idle-close, and health-check replacement behavior.

索引モデルが issue の本文から書いたものです。

説明

enhancement

Summary

PoolConfig is missing the standard set of options that deadpool / bb8 / r2d2 users expect (timeouts, idle/lifetime caps, min-idle, configurable health check). And there is no sync connection pool at all — pooling is async-only. Users with a sync app today either roll their own pool or block on the async one from a runtime.

Current state

hyperdb-api/src/pool.rsPoolConfig exposes only endpoint, database, create_mode, user, password, max_size. The recycle path unconditionally runs execute_command("SELECT 1").

$ grep -n "wait_timeout\|create_timeout\|recycle_timeout\|max_lifetime\|idle_timeout\|min_idle" \
    hyperdb-api/src/pool.rs
# (no output)

Original gap analysis: §6 of docs/RUST_API_GAP_ANALYSIS.md (predecessor repo).

Proposed work

  • Add timeouts to PoolConfig:
    • wait_timeout: Option<Duration> — how long acquire will block before erroring.
    • create_timeout: Option<Duration> — bound on a single Connection::connect.
    • recycle_timeout: Option<Duration> — bound on the health-check round-trip.
  • Add lifetime/idle caps:
    • max_lifetime: Option<Duration> — connection is closed when older than this.
    • idle_timeout: Option<Duration> — idle connection is closed after this duration.
    • min_idle: Option<u32> — pool keeps at least this many warm.
  • Pluggable health-check strategy: a recycle: RecycleStrategy enum (SelectOne, Ping, Custom(...), None) instead of hardcoded SELECT 1.
  • Add a sync ConnectionPool mirroring the async pool's surface — r2d2-style — for sync apps. Same PoolConfig, same semantics, no Tokio dependency in the sync path.
  • Tests covering each new option (timeout fires, idle close fires, health-check failure replaces the connection).

Backwards compatibility

Purely additive — new optional fields default to None (current behavior preserved). New sync pool is a new public type.

Performance note

The defaults must keep current behavior identical: None everywhere (no timeout, no idle cap), recycle = SelectOne. Existing users who specify only endpoint/database/max_size should see no change.

主要言語
Rust
スター
2
フォーク
2
平均マージ
12時間 2分
マージ済み PR(30日)
60

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

tableau/hyper-api-rust のほかの issue

tableau/hyper-api-rust の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。