Branch: refs/heads/master
Home: https://github.com/conformal/btcwallet
Commit: 7ca16dfe70799e73422dd28d2a37ebb5ae06757d
https://github.com/conformal/btcwallet/commit/7ca16dfe70799e73422dd28d2a37ebb5ae06757d
Author: Josh Rickmar <[email protected]>
Date: 2014-07-14 (Mon, 14 Jul 2014)
Changed paths:
M rpcserver.go
Log Message:
-----------
Synchronize notifications and client gr shutdown.
The responses chan for a websocket client was being closed by one of
the websocket goroutines, but it was not the only sender to this
channel. There was also the notification handler, run by the server
to handle notifications to all websocket clients. It was possible to
hit cases where sends to this channel would still occur (the select
statement doesn't guarantee that the picked channel operation won't
panic, even if there's another that won't). To fix this, wait on the
client being removed from the notification group, or if the server is
already shutting down, wait on the notification handler completely
closing, to ensure that no more sends to the channel will occur,
before closing the channel.
Fixes #110.