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

Add SELECT 1 check to Exists/CanConnect checks #18508

Merged
merged 1 commit into from
Oct 23, 2019
Merged

Conversation

roji
Copy link
Member

@roji roji commented Oct 22, 2019

Fixes #18330

Note that the connection.Open operation has passes errorsExpected: true, so that connection errors are logged as debug. We can do this for the SELECT 1 command as well, but I think the main idea here is to squash "does not exist" errors specifically, which really aren't an error. Other types of errors (e.g. connectivity) still seem like they should log an error, since it's not a matter of the database not being created. But if someone thinks otherwise I can add errorsExpected to command failure logging.

@ErikEJ
Copy link
Contributor

ErikEJ commented Oct 22, 2019

Why the additional logging?

@roji
Copy link
Member Author

roji commented Oct 22, 2019

@ErikEJ what do you mean?

@ErikEJ
Copy link
Contributor

ErikEJ commented Oct 22, 2019

The call to .ExecuteNonQuery - but maybe it always is logged?

@roji
Copy link
Member Author

roji commented Oct 22, 2019

Yeah, the call is logged like any other command execution (assuming you've enabled it etc.). Do you see an issue here?

We can specifically exempt logging this command, but I'm not sure whether that would be the right thing to do (see also comment in the OP).

@roji roji force-pushed the ExistsSelectCheck branch from 2e5839e to fd4cd15 Compare October 23, 2019 07:30
@roji roji merged commit a1cb74b into release/3.1 Oct 23, 2019
@roji roji deleted the ExistsSelectCheck branch October 23, 2019 09:39
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.

DatabaseFacade.CanConnect doesn't actually check anything
3 participants