MySQL: idle pool connections die after wait_timeout, log shows broken pipe
Maintainer thường phản hồi trong vòng 4 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 15.1k
- Fork
- 726
- Merge trung bình
- 4 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 27
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của crowdsecurity/crowdsec
-
needs/kind needs/triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
crowdsecurity/crowdsec#4849 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
kind/bug needs/triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
crowdsecurity/crowdsec#4847 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
kind/bug needs/triage os/linux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
crowdsecurity/crowdsec#4836 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
victorialogs datasource passes the trailing newline of a message to the parsers (traefik-logs 1.6 fails on every line)Có thể đã có người làm @IlayWolfson đã nhận 6 ngày trước. Đang mởkind/bug needs/triage os/linux version/1.8.2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
crowdsecurity/crowdsec#4820 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
[email protected]Đang mởneeds/kind needs/triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
crowdsecurity/crowdsec#4842 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của crowdsecurity/crowdsec
Issue tương tự
-
tld-snapshot
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
awslabs/ferret-scan#1064 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
【文档错误】创建镜像空间步骤中的截图标注与文字描述不一致Đang mởenhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
DaoCloud/DaoCloud-docs#7839 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Ignore entry for RUSTSEC-2026-0002 no longer matches anything (`lru` is no longer in `Cargo.lock`)Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
influxdata/influxdb#27767 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Support AlienVault OTX API keysĐang mởType: Enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
projectdiscovery/urlfinder#167 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
gojue/ecapture#1100 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày