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

Reconnect Cassandra client and reinit session when NoHostAvailableException #60

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

yma96
Copy link
Member

@yma96 yma96 commented Oct 21, 2024

Please refer the comments https://issues.redhat.com/browse/MMENG-4231, the workaround solution, and I could try to test on devel to verify.

@yma96 yma96 requested review from ligangty, sswguo and ruhan1 October 21, 2024 04:23
client.init();
this.init();
}
trackingRecord = session.execute( bind );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if the session need to be a new one or not, for example in tracking service cluster.connect() may try to reconnect. But you can test locally if you have the instance for test before.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or I see, there is client.init(). so let's have a try.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sswguo Yeah, the session refetch will call through this class init method. I've tested locally, it could reconnect immediately after re-startup if relocated db server to a different IP, but still need to validate in the real devel Cluster env, I'll merge this to have a try.

@yma96 yma96 merged commit 2052c47 into Commonjava:main Oct 21, 2024
4 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants