Comments (7)
After tracing this I've found that rpcclient was trying to auto-reconnect, so I've set DisableAutoReconnect
to true
and now it raises the error as expected. I'm still finding a hang but it's for Wait
on btcwallet
to exit after receiving a SIGINT.
I've updated the gist to demonstrate the issue with btcwallet
from btcrpcclient.
If this is hanging before the Wait calls for the btcwallet process, and not after (when you make a final call to GetNewAddress, then wallet isn't shutting down correctly. Can you run wallet with profiling and dump the goroutines?
from btcrpcclient.
Here's the dump of goroutines when it hangs:
https://gist.github.com/tuxcanfly/549ec22a9d4496117028
I can see that when I hit Ctrl+C
manually, it shuts down correctly:
23:32:23 2014-07-01 [INF] BTCW: Received SIGINT (Ctrl+C). Shutting down...
23:32:23 2014-07-01 [WRN] BTCW: Server shutting down
23:32:23 2014-07-01 [WRN] BTCW: Disconnecting chain server client connection
^C23:32:26 2014-07-01 [INF] BTCW: Received SIGINT (Ctrl+C). Shutting down...
23:32:26 2014-07-01 [WRN] BTCW: Server already shutting down
23:32:26 2014-07-01 [INF] BTCW: Disconnected websocket client 127.0.0.1:41610
23:32:26 2014-07-01 [INF] BTCW: Shutdown complete
from btcrpcclient.
Steps to repro:
Keep rpcclient connection open, I have something like this in a simple test script:
for i := 0; i < 10; i++ {
time.Sleep(time.Second)
addr, err := client.GetNewAddress()
if err != nil {
log.Printf("Cannot generate new address: %v", err)
}
log.Printf("Address: %v", addr)
}
While this is running, I interrupt btcwallet
with SIGINT. Both btcwallet
as well as rpcclient
hang.
Here's the goroutine dump for btcwallet
: https://gist.github.com/tuxcanfly/924fc97f4fed16cd383d
from btcrpcclient.
That looks like a btcwallet clean shutdown bug, not the issue I was seeing with the rpcclient hanging. In this case, wallet is waiting for new messages from a websocket client (rpcserver.go:433) instead of erroring and breaking out of the loop (which should shut down the remaining rpcserver goroutines).
from btcrpcclient.
OK, I was guessing this was the same rpcclient issue because once btcwallet
hangs, it keeps the client waiting.
I guess this issue should be moved to btcwallet.
from btcrpcclient.
The shutdown hangs in btcrpcclient have been resolved as of commit 656fa86.
from btcrpcclient.
Related Issues (20)
- how to get the send address by TxID? HOT 1
- Remove -v to unclutter travis logs
- map[btcutil.Address]btcutil.Amount in sendmany is a pretty dangerous HOT 7
- Missing getmempoolentry HOT 3
- bip125-replaceable is missing in ListTransactionsResult HOT 1
- Parsing received notifications should not check for exact number of positional parameters HOT 1
- Variable coin symbol HOT 1
- Missing `gettxoutproof` HOT 1
- TransactionInput doesn't have a sequence HOT 1
- GetTransaction includeWatchOnly HOT 3
- OP_RETURN Transaction HOT 2
- New RPC Commands
- Errors when connecting via proxy HOT 7
- addwitnessaddress is missing HOT 1
- json: cannot unmarshal number -1 into Go struct field GetBlockVerboseResult.confirmations of type uint64
- client.GetBlockVerboseTx does not work with bitcoind
- Getting block by hash doesn't return height HOT 2
- ListSinceBlock and ListSinceBlockMinConf docs are dangerously wrong HOT 1
- getblockheader is not exposed HOT 3
- `GetBlockVerbose` is broken for bitcoin core HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from btcrpcclient.