Skip to content

Fixes around initial discovery #453

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

Merged
merged 12 commits into from
Apr 30, 2019
Merged

Conversation

ali-ince
Copy link
Contributor

This PR introduces a couple of fixes around initial/fallback routing discovery through seed router.

  1. Introduce a dedicated ServerAddress class to hold server addresses, including resolved IP addresses, to be used across the driver to establish connections. This is specifically done to fix a failure where we forget host name (required for SNI to work) and rely on IP addresses to establish TLS connections where TLS connection is towards an endpoint that expects SNI. The introduced class will always include the initial host name even after it is resolved through DNS.
  2. The routing driver, when constructed, attempts discovery through the provided seed URI and then falled back to configured custom resolver. This was not the intended behaviour with initial discovery and it is now defaulted to use seed URI applied to provided custom resolver results of which are passed on to DNS resolution. This is the behaviour which will apply on initial and fall-back to initial discovery.

const connectionPromise = this._freshRoutingTable(accessMode).then(routingTable => {
if (accessMode === READ) {
const address = this._loadBalancingStrategy.selectReader(routingTable.readers);
const address = that._loadBalancingStrategy.selectReader(routingTable.readers);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is variable that needed here? It looks like a reference copy to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

definitely not :) thanks for the catch.

@ali-ince ali-ince force-pushed the 1.7-sni-on-seed-router branch from 84239f9 to 0396124 Compare April 30, 2019 19:02
@ali-ince ali-ince merged commit 6e48356 into neo4j:1.7 Apr 30, 2019
@ali-ince ali-ince deleted the 1.7-sni-on-seed-router branch April 30, 2019 20:14
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