-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request]: Wait for bitcoin-cli to warmup before crashing #1533
Comments
Well |
I did not experienced it yet, but this will probably happen when I run LND on mainnet. I carefully looked your code (lnd and rpcClient), and could not find any place where you handle RPC error code -28 (RPC_IN_WARMUP). LND fails to start when I get wrong RPC credentials (which is expected), so I am assuming (wrongly?) that it also would if calls to bitcoin rpc returns RPC_IN_WARMUP error. |
As I was expecting: here the error
|
This modifies the `Start` method to handle the `RPC_IN_WARMUP` error code of `-28` by retrying the rpc call to determine the current network every second until it either succeeds or fails with a different code. The current behavior fails and terminates the connection upon receiving this error code. This change allows for connecting to a recently started bitcoind node and starting the client while bitcoind is still warming up. Related issue: lightningnetwork/lnd#1533
This modifies the `Start` method to handle the `RPC_IN_WARMUP` error code of `-28` by retrying the rpc call to determine the current network every second until it either succeeds or fails with a different code. The current behavior fails and terminates the connection upon receiving this error code. This change allows for connecting to a recently started bitcoind node and starting the client while bitcoind is still warming up. Related issues: lightningnetwork/lnd#1533 & https://github.com/ExchangeUnion/xud-docker/issues/195
I came up with a solution for this in the btcwallet code and it resolves this issue nicely in my tests. I couldn't come up with an elegant way to address the issue within the lnd codebase. |
Would this indirectly be fixed with the backend healthcheck that is now implemented? Causing |
The way I fixed it is, I have my UTXO tracker NBXplorer writing some file when the node is ready. |
This modifies the `Start` method to handle the `RPC_IN_WARMUP` error code of `-28` by retrying the rpc call to determine the current network every second until it either succeeds or fails with a different code. The current behavior fails and terminates the connection upon receiving this error code. This change allows for connecting to a recently started bitcoind node and starting the client while bitcoind is still warming up. Related issues: lightningnetwork/lnd#1533 & https://github.com/ExchangeUnion/xud-docker/issues/195
This modifies the `Start` method to handle the `RPC_IN_WARMUP` error code of `-28` by retrying the rpc call to determine the current network every second until it either succeeds or fails with a different code. The current behavior fails and terminates the connection upon receiving this error code. This change allows for connecting to a recently started bitcoind node and starting the client while bitcoind is still warming up. Related issues: lightningnetwork/lnd#1533 & https://github.com/ExchangeUnion/xud-docker/issues/195
This modifies the `Start` method to handle the `RPC_IN_WARMUP` error code of `-28` by retrying the rpc call to determine the current network every second until it either succeeds or fails with a different code. The current behavior fails and terminates the connection upon receiving this error code. This change allows for connecting to a recently started bitcoind node and starting the client while bitcoind is still warming up. Related issues: lightningnetwork/lnd#1533 & https://github.com/ExchangeUnion/xud-docker/issues/195
This modifies the `Start` method to handle the `RPC_IN_WARMUP` error code of `-28` by retrying the rpc call to determine the current network every second until it either succeeds or fails with a different code. The current behavior fails and terminates the connection upon receiving this error code. This change allows for connecting to a recently started bitcoind node and starting the client while bitcoind is still warming up. Related issues: lightningnetwork/lnd#1533 & https://github.com/ExchangeUnion/xud-docker/issues/195
This modifies the `Start` method to handle the `RPC_IN_WARMUP` error code of `-28` by retrying the rpc call to determine the current network every second until it either succeeds or fails with a different code. The current behavior fails and terminates the connection upon receiving this error code. This change allows for connecting to a recently started bitcoind node and starting the client while bitcoind is still warming up. Related issues: lightningnetwork/lnd#1533 & https://github.com/ExchangeUnion/xud-docker/issues/195
In cases of very brief interruptions, this should be addressed by btcsuite/btcd#1743 |
This is still an ongoing issue (FreeBSD 13.1, bitcoind 0.24.0, lnd 0.15.5) . Here is a reboot situation, rc.d scrip for lnd requires bitcoind to start first
I can hack it by introducing a |
I'm stuck with this issue too. Without lnd waiting for bitcoind to start up it will never be possible to automatically start a node in a predictable way. It could crash just because bitcoind takes 15 minutes to start up one day, rather than 14. |
I still think my PR here would fix this: btcsuite/btcwallet#677 Then there'd need to be another PR against lnd to use the updated dependency. |
If
lnd
start beforebitcoind
is fully started (like for example ifbitcoind
is checking blocks),lnd
will crash.Can
lnd
wait automatically in a similar way tobitcoin-cli -rpcwait getblockchaininfo
?The text was updated successfully, but these errors were encountered: