MySQL: idle pool connections die after wait_timeout, log shows broken pipe
メンテナーはふだん 4 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 35/100
調査の方向性
The issue identifies getEntDriver as the entry point and links the go-sql-driver/mysql guidance on SetConnMaxLifetime; start by locating that function and checking how it configures the MySQL driver. The issue proposes a three-minute connection lifetime. Done means MySQL connections receive that setting and the reported broken-pipe log stops recurring; an open pull request already addresses the issue.
索引モデルが issue の本文から書いたものです。
説明
With a MySQL backend, crowdsec keeps idle connections in the database/sql pool with no lifetime limit. After the server-side wait_timeout (600s here) MySQL closes them, and the next query on such a connection logs:
[mysql] packets.go:155 write tcp 127.0.0.1:55054->127.0.0.1:3310: write: broken pipe
[mysql] connection.go:803 closing bad idle connection: unexpected read from socket
database/sql retries on a fresh connection, so queries still succeed, but the log gets these lines every time the pool picks a dead connection (about a dozen a day on our host, crowdsec 1.8.2).
go-sql-driver/mysql asks for SetConnMaxLifetime shorter than the server and middleware timeouts and suggests under 5 minutes: https://github.com/go-sql-driver/mysql#important-settings
Fix: set ConnMaxLifetime to 3 minutes for the mysql driver in getEntDriver. PR follows.
- 主要言語
- Go
- スター
- 15.1k
- フォーク
- 726
- 平均マージ
- 4日 23時間
- マージ済み PR(30日)
- 27
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
crowdsecurity/crowdsec のほかの issue
-
needs/kind needs/triage
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
crowdsecurity/crowdsec#4849 · コメント 2 件 ·
メンテナーはふだん 4 日以内に返信
-
kind/bug needs/triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
crowdsecurity/crowdsec#4847 · コメント 3 件 ·
メンテナーはふだん 4 日以内に返信
-
kind/bug needs/triage os/linux
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
crowdsecurity/crowdsec#4836 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
victorialogs datasource passes the trailing newline of a message to the parsers (traefik-logs 1.6 fails on every line)対応中かも @IlayWolfson が 6 日前に担当しました。 オープンkind/bug needs/triage os/linux version/1.8.2
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
crowdsecurity/crowdsec#4820 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
[email protected]オープンneeds/kind needs/triage
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
crowdsecurity/crowdsec#4842 · コメント 3 件 ·
メンテナーはふだん 4 日以内に返信
crowdsecurity/crowdsec の issue をすべて見る
似ている issue
-
tld-snapshot
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
awslabs/ferret-scan#1064 ·
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
DaoCloud/DaoCloud-docs#7839 ·
メンテナーはふだん 1 日以内に返信
-
Ignore entry for RUSTSEC-2026-0002 no longer matches anything (`lru` is no longer in `Cargo.lock`)オープン
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
influxdata/influxdb#27767 ·
メンテナーはふだん 1 日以内に返信
-
Type: Enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
projectdiscovery/urlfinder#167 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
gojue/ecapture#1100 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信