CPP-953 Naive attempt to avoid pure virtual function calls at cluster shutdown#524
CPP-953 Naive attempt to avoid pure virtual function calls at cluster shutdown#524absurdfarce wants to merge 2 commits intomasterfrom
Conversation
…g executing host up checks when closing the handler
|
|
||
| void PrepareHostHandler::on_close(Connection* connection) { | ||
| callback_(this); | ||
|
|
There was a problem hiding this comment.
@mpenick What do you think of this idea? The callback here is Cluster::on_prepare_host_up and it doesn't look like there's any benefit to calling it when we're shutting down the cluster anyway. And if we don't call it we should avoid tangling up Cluster and PrepareHostHandler method calls... which should remove the possibility of a pure virtual function call.
Does this make sense or am I missing something?
There was a problem hiding this comment.
I think this is going after the symptom instead of fixing the cause. My bet is the listener which is SessionBase is being freed before the the Cluster object is finished with it.
| // Wait for the node to become available and verify no statements have been | ||
| // prepared | ||
| wait_for_node_on_session(session, 1); | ||
| wait_for_node_on_session(session_for_node(1), 1); |
There was a problem hiding this comment.
Minor test change. wait_for_node_on_session() is querying system.local so to get a robust comparison we should always use a clean session, especially after bootstrapping a new node. I was seeing these tests fail due to a belief that the node was unavailable; after digging in it looked as if the session was simply querying the wrong node.
|
Replaced by #578 |
Attempt to avoid entangling PrepareHostHandler and Cluster by avoiding executing host up checks when closing the handler