-
Notifications
You must be signed in to change notification settings - Fork 803
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
MySql check no longer uses Ping #2031
Comments
A PR is welcome on this! |
Users can opt in to setting a command that will be executed on the server, but the default is now a more efficient ping.
Users can opt in to setting a command that will be executed on the server, but the default is now a more efficient ping.
There is actually another reason to restore the PING command, with this issue What is happening is that the Docker image for MySql will start in a temporary state then restart in its final state. The health check based on connection string will report healthy during this pre-initialization state. the binary communication however is not enabled until the final restart is done. In Aspire I am seeing that the functional tests are failing as they are waiting for the health checks to be successful, but then the mysql calls fail because the server restarts. |
I'm not sure that using "ping" will help this scenario. If the health check that sends |
What would you like to be added:
Before #1835,
MySqlHealthCheck
usedPingAsync
to check the server health. It now defaults toSELECT 1;
.I would like to be able to opt in to using a ping, or even having that restored as the default behavior.
I propose setting the default
MySqlHealthCheckOptions.CommandText
value tonull
, and havingMySqlHealthCheck
interpret that as meaning "ping the server". IfCommandText
is non-null
, then it would be used to form aMySqlCommand
.Why is this needed:
A
COM_PING
packet will be much more lightweight to send to the server instead of executing a query, even a simple one.The text was updated successfully, but these errors were encountered: