loopd: shutdown hangs when lnd goes away
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- go
- Ambito
- backend, distributed-systems
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Go
- Stelle
- 593
- Fork
- 139
- Merge medio
- 2g 8h
- PR unite (30g)
- 21
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di lightninglabs/loop
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
lightninglabs/loop#1246 ·
I maintainer di solito rispondono entro 1 giorno
-
staticaddr: a deposit unlocked between the refresh and the lookup can be quoted or selectedForse già presa @claravanstaden l’ha presa 18 giorni fa. Apertastatic-loop-in
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
lightninglabs/loop#1289 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
GPG key, GPG key fingerprintAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 49/100
lightninglabs/loop#1276 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 15/100
lightninglabs/loop#1274 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 50/100
lightninglabs/loop#1208 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di lightninglabs/loop
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Cojekt/LibreDental#258 ·
I maintainer di solito rispondono entro 1 giorno
-
go good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
opensro-dev/opensro#4949 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 3 giorni
-
agent-execution/02 row 4: consumers Verify row lacks delivery/base binding, cannot pass post-mergeApertabug effort:s impact:low raised-by:verifier risk:low
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
medici-finance/assay#7946 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno