lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.71k stars 2.09k forks source link

queryroutes doesn't return (actually it finally did) #1634

Closed robtex closed 6 years ago

robtex commented 6 years ago

lnd version 0.4.2-beta commit=098cd940e312c111dda3efe5fa2c7d375743f770

$lncli queryroutes 02e6b17c5a7a2461df38d0a571d92660f38ed5bbc847166ee655a1d0f83c1aa5ac 1

took 12 minutes to return

process dump while it was working: http://paste.ubuntu.com/p/52zNJPtjJx/

noticed log is scrolling with messages like


2018-07-26 09:38:01.017 [ERR] DISC: unable to reply to peer query: unknown message: *lnwire.ReplyShortChanIDsEnd
2018-07-26 09:38:01.567 [ERR] DISC: unable to reply to peer query: unknown message: *lnwire.ReplyShortChanIDsEnd
2018-07-26 09:38:02.073 [INF] CRTR: New channel discovered! Link connects 02551a0f955f86c892682487cc9403c4caf09ec37ae427b4475ea62379e94b15fe and 02df803ba0b435b912556c83c97fc5d3aba191f114b2c468c3062ae18c902ebdfc with ChannelPoint(19fe2b19e76a8352b58cd799b4df811a62cc2109ade17c8f4eecc25c3ea3d298:1): chan_id=570273800504737793, capacity=0.0002 BTC
2018-07-26 09:38:02.152 [ERR] DISC: unable to reply to peer query: unknown message: *lnwire.ReplyShortChanIDsEnd
2018-07-26 09:38:02.168 [ERR] DISC: unable to reply to peer query: unknown message: *lnwire.ReplyShortChanIDsEnd
2018-07-26 09:38:02.176 [ERR] DISC: unable to reply to peer query: unknown message: *lnwire.ReplyShortChanIDsEnd```

i hope a single peer doesn't mutex the entire graph discovery code.
Roasbeef commented 6 years ago

Those messages are unrelated. Access to the db is allowed by multiple readers so only if a writer is active (new chans or w/e) would the call block.

Roasbeef commented 6 years ago

Only intersting thing I can see in the logs is:

1 @ 0x786ba0 0x776a18 0x779d01 0x776d7d 0x776247 0x775c58 0x838570 0x8388e3 0xb45dbe 0xb62377 0xb614af 0xb69eb9 0x45c4c1
#   0x786b9f    encoding/json.stateInString+0xff                                        /usr/lib/go-1.10/src/encoding/json/scanner.go:336
#   0x776a17    encoding/json.(*decodeState).scanWhile+0x57                                 /usr/lib/go-1.10/src/encoding/json/decode.go:358
#   0x779d00    encoding/json.(*decodeState).literal+0x40                                   /usr/lib/go-1.10/src/encoding/json/decode.go:814
#   0x776d7c    encoding/json.(*decodeState).value+0x30c                                    /usr/lib/go-1.10/src/encoding/json/decode.go:411
#   0x776246    encoding/json.(*decodeState).unmarshal+0x1e6                                    /usr/lib/go-1.10/src/encoding/json/decode.go:189
#   0x775c57    encoding/json.Unmarshal+0x147                                           /usr/lib/go-1.10/src/encoding/json/decode.go:108
#   0x83856f    github.com/lightningnetwork/lnd/vendor/github.com/btcsuite/btcd/rpcclient.FutureGetBlockResult.Receive+0xcf /home/lnd/gocode/src/github.com/lightningnetwork/lnd/vendor/github.com/btcsuite/btcd/rpcclient/chain.go:69
#   0x8388e2    github.com/lightningnetwork/lnd/vendor/github.com/btcsuite/btcd/rpcclient.(*Client).GetBlock+0x42       /home/lnd/gocode/src/github.com/lightningnetwork/lnd/vendor/github.com/btcsuite/btcd/rpcclient/chain.go:109
#   0xb45dbd    github.com/lightningnetwork/lnd/lnwallet/btcwallet.(*BtcWallet).GetBlock+0x3d                   /home/lnd/gocode/src/github.com/lightningnetwork/lnd/lnwallet/btcwallet/blockchain.go:127
#   0xb62376    github.com/lightningnetwork/lnd/routing.(*ChannelRouter).fetchChanPoint+0x96                    /home/lnd/gocode/src/github.com/lightningnetwork/lnd/routing/router.go:1165
#   0xb614ae    github.com/lightningnetwork/lnd/routing.(*ChannelRouter).processUpdate+0x105e                   /home/lnd/gocode/src/github.com/lightningnetwork/lnd/routing/router.go:963
#   0xb69eb8    github.com/lightningnetwork/lnd/routing.(*ChannelRouter).networkHandler.func1+0x1d8             /home/lnd/gocode/src/github.com/lightningnetwork/lnd/routing/router.go:691

Closing for now, will open if you're able to reliably replicate it.