Skip to content

Implement connection validation #173

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 3 commits into from
Nov 20, 2019
Merged

Implement connection validation #173

merged 3 commits into from
Nov 20, 2019

Conversation

elefeint
Copy link
Contributor

Behavior change:

  • Null out session when connection is closed.
  • Local validation relies on having a valid session (it checks for session name, but that's only going to be non-null if and only if the connection is non-null.)
  • Remote validation is implemented as a low-level GrpcClient healthcheck. It sends a trivial query to Spanner over executeSql (as opposed to executeStreamingSql).

TCK test change:

  • Removed session pools from TCK tests
  • Suppressed error logging when already-existing tables try to get created. This operation also takes forever; need to check whether pre-querying tables will be faster.

Fixes #162 .

Copy link
Member

@meltsufin meltsufin left a comment

Choose a reason for hiding this comment

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

No major concerns. Just small nits.

private static final int PORT = 443;

private final Logger logger = LoggerFactory.getLogger(this.getClass());
Copy link
Member

Choose a reason for hiding this comment

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

static

)
.map(rs -> Boolean.TRUE)
.onErrorResume(error -> {
this.logger.warn("Spanner healthcheck failed", error);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
this.logger.warn("Spanner healthcheck failed", error);
this.logger.warn("Cloud Spanner healthcheck failed", error);

@elefeint elefeint force-pushed the connection-validation branch from ba06303 to 985802b Compare November 20, 2019 21:35
@elefeint elefeint requested a review from meltsufin November 20, 2019 21:38
@elefeint elefeint merged commit 107c976 into master Nov 20, 2019
@elefeint elefeint deleted the connection-validation branch November 26, 2019 20:36
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.

Implement Connection.validate
2 participants