loopd: shutdown hangs when lnd goes away
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go
- Lĩnh vực
- backend, distributed-systems
Hướng nghiên cứu
Start in loopd/daemon.go: the internalErrChan buffer size where it is created, the swap client send near line 854, the static address loop-in manager send near line 1048, and Daemon.stop near line 1164. Reproduce by stopping and restarting lnd under a running loopd and watching for the hang after 'Runtime error in daemon, shutting down'. Done when shutdown completes, the macaroon db is released, and a new loopd can start.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
When lnd stops or restarts under a running loopd, the daemon starts to shut down and then hangs. The process stays alive, the RPC port is closed, and the macaroon database stays locked, so a new loopd fails with "unable to open macaroon db: timeout".
Cause
internalErrChan has room for four errors (make(chan error, 4) in loopd/daemon.go) and is read once. After that read the daemon calls stop(), which waits for the wait group. When lnd goes away, more goroutines report an error than the channel can hold. The rest block on the send, inside goroutines the wait group is waiting for.
The comment at the swap client's send says "We don't have to worry about blocking as the internal error channel is sufficiently buffered", which no longer holds with the number of managers that now send to it.
Goroutine dump from a hung daemon on master (b41a3a32):
goroutine 114 [chan send]: loopd/daemon.go:854 (swap client)
goroutine 218 [chan send]: loopd/daemon.go:1048 (static address loop-in manager)
goroutine 364 [sync.WaitGroup.Wait]: loopd/daemon.go:1164 (*Daemon).stop
Steps
- Run
loopdagainst lnd on regtest, with experimental features on. - Restart lnd.
loopdlogs "Runtime error in daemon, shutting down" and never logs "Daemon exited".
Reproduced three times in three tries.
Possible fix
Send to internalErrChan without blocking (a select with d.quit, or a default case), or keep draining the channel while stop() runs.
- Ngôn ngữ chính
- Go
- Star
- 593
- Fork
- 139
- Merge trung bình
- 2 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 21
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
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 lightninglabs/loop
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
lightninglabs/loop#1246 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
staticaddr: a deposit unlocked between the refresh and the lookup can be quoted or selectedCó thể đã có người làm @claravanstaden đã nhận 18 ngày trước. Đang mởstatic-loop-in
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
lightninglabs/loop#1289 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
GPG key, GPG key fingerprintĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 49/100
lightninglabs/loop#1276 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
lightninglabs/loop#1274 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 50/100
lightninglabs/loop#1208 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của lightninglabs/loop
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Cojekt/LibreDental#258 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
cmd/podiomd: permission MCP stalls the turn when a tool input exceeds the 64KB scanner limitĐang mởgo good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
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 78/100
opensro-dev/opensro#4949 ·
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 82/100
Maintainer thường phản hồi trong vòng 3 ngày
-
agent-execution/02 row 4: consumers Verify row lacks delivery/base binding, cannot pass post-mergeĐang mởbug effort:s impact:low raised-by:verifier risk:low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
medici-finance/assay#7946 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày