-
Notifications
You must be signed in to change notification settings - Fork 287
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
CPP-953 Naive attempt to avoid pure virtual function calls at cluster shutdown #524
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -369,7 +369,7 @@ CASSANDRA_INTEGRATION_TEST_F(PrepareOnUpAndAddTests, NotPreparedOnUpWhenDisabled | |
|
||
// 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. |
||
prepared_statements_are_not_present(1); | ||
} | ||
|
||
|
@@ -404,7 +404,7 @@ CASSANDRA_INTEGRATION_TEST_F(PrepareOnUpAndAddTests, PreparedOnUpWhenEnabled) { | |
|
||
// Wait for the node to become available and verify that the statements | ||
// in the prepared metadata cache have been prepared | ||
wait_for_node_on_session(session, 1); | ||
wait_for_node_on_session(session_for_node(1), 1); | ||
prepared_statements_are_present(1); | ||
} | ||
|
||
|
@@ -435,7 +435,7 @@ CASSANDRA_INTEGRATION_TEST_F(PrepareOnUpAndAddTests, NotPreparedOnAddWhenDisable | |
|
||
// Wait for the new node to become available and verify no statements have | ||
// been prepared | ||
wait_for_node_on_session(session, node); | ||
wait_for_node_on_session(session_for_node(node), node); | ||
prepared_statements_are_not_present(node); | ||
} | ||
|
||
|
@@ -466,6 +466,6 @@ CASSANDRA_INTEGRATION_TEST_F(PrepareOnUpAndAddTests, PreparedOnAddWhenEnabled) { | |
|
||
// Wait for the new node to become available and verify that the statements | ||
// in the prepared metadata cache have been prepared | ||
wait_for_node_on_session(session, node); | ||
wait_for_node_on_session(session_for_node(node), node); | ||
prepared_statements_are_present(node); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.