Fixes ZMQ startup with bad arguments.#7621
Conversation
|
|
||
| if (i!=notifiers.end()) | ||
| { | ||
| Shutdown(); |
There was a problem hiding this comment.
NACK, this implies that the caller calls Shutdown() if return is false.
There was a problem hiding this comment.
The destructor will call it, which will be invoked automatically whether Initialize returns false or not.
There was a problem hiding this comment.
@laanwj assuming you delete the object.. nevertheless Initialize() should be all or nothing. Removing the call to Shutdown() leaves the notification interface partially initialised.
There was a problem hiding this comment.
@promag CreateWithArguments deletes the object if initialization fails
There was a problem hiding this comment.
@mrbandrews @laanwj right, forgot Initialize() is protected. I take it back.
There was a problem hiding this comment.
assuming you delete the object
Sure. But well if not that's a memory leak, and thus a bug in self.
|
utACK 0040118 |
|
utACK 0040118. |
|
utACK |
0040118 Fixes ZMQ startup with bad arguments. (mrbandrews)
|
utACK 0040118 |
Add ZeroMQ notifications Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6103 - bitcoin/bitcoin#6684 - bitcoin/bitcoin#6686 - bitcoin/bitcoin#6736 - bitcoin/bitcoin#6739 - bitcoin/bitcoin#6743 - bitcoin/bitcoin#6768 - bitcoin/bitcoin#6779 - bitcoin/bitcoin#6810 - bitcoin/bitcoin#6927 - bitcoin/bitcoin#6980 (only upgrading zeromq) - bitcoin/bitcoin#6680 - bitcoin/bitcoin#7058 - bitcoin/bitcoin#7621 - bitcoin/bitcoin#7335 (only parts affecting `zmq_test.py`) - bitcoin/bitcoin#7853 (only parts affecting `zmq_test.py`) - bitcoin/bitcoin#7762 - bitcoin/bitcoin#7993 (only upgrading zeromq) - bitcoin/bitcoin#8238 - bitcoin/bitcoin#8701 - bitcoin/bitcoin#6685 Closes #2020.
Add ZeroMQ notifications Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6103 - bitcoin/bitcoin#6684 - bitcoin/bitcoin#6686 - bitcoin/bitcoin#6736 - bitcoin/bitcoin#6739 - bitcoin/bitcoin#6743 - bitcoin/bitcoin#6768 - bitcoin/bitcoin#6779 - bitcoin/bitcoin#6810 - bitcoin/bitcoin#6927 - bitcoin/bitcoin#6980 (only upgrading zeromq) - bitcoin/bitcoin#6680 - bitcoin/bitcoin#7058 - bitcoin/bitcoin#7621 - bitcoin/bitcoin#7335 (only parts affecting `zmq_test.py`) - bitcoin/bitcoin#7853 (only parts affecting `zmq_test.py`) - bitcoin/bitcoin#7762 - bitcoin/bitcoin#7993 (only upgrading zeromq) - bitcoin/bitcoin#8238 - bitcoin/bitcoin#8701 - bitcoin/bitcoin#6685 Closes #2020.
Fixes #7496.
A bad ZMQ argument caused the code to create a socket but not destroy it and later in the shutdown code, zmq_destroy() hangs as a result.
This also removes a gratuitous call to the Shutdown method of ZMQNotificationInterface; the code calls the destructor right after returning, which calls Shutdown.