Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/prepare_host_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ void PrepareHostHandler::prepare(uv_loop_t* loop, const ConnectionSettings& sett
}

void PrepareHostHandler::on_close(Connection* connection) {
callback_(this);

Copy link
Collaborator Author

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?

Copy link
Contributor

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.

dec_ref(); // The event loop is done with this handler
}

Expand Down