canonical / mysql-k8s-operator

A Charmed Operator for running MySQL on Kubernetes
https://charmhub.io/mysql-k8s
Apache License 2.0
8 stars 15 forks source link

Re-throw the exception when checking mysqlsh connection #361

Closed motjuste closed 5 months ago

motjuste commented 6 months ago

Issue

When connection to mysqlsh is checked, any MySQLClientError is swallowed. This does not help with debuggability.

Solution

Change the API from returning a bool to returning nothing, but promising the faithfully throw an exception while checking mysqlsh connection if one occurred, without losing any information that can help with debugging. The call-site can then do the same, better here with a higher-level error, but again, without losing any details of the original error.

motjuste commented 6 months ago

I am not sure why some of the Juju 2.9 integration tests fail as I do not believe I have modified any code related to those failures. The integration tests for Juju 3.1.6 pass.

motjuste commented 6 months ago

The problem I am trying to debug is the issue #310 on Juju 3.1.6 on top of microk8s 1.24 that I have been banging my head against while trying to deploy the MLFlow bundle. I hope that this change will help me debug that issue better.

paulomach commented 6 months ago

@motjuste , latest merge added exception logging - if you believe it's enough I would like to close this PR

motjuste commented 5 months ago

@motjuste , latest merge added exception logging - if you believe it's enough I would like to close this PR

Hi ... sorry for late response ... looks good, since logger.exception will also add the exception info. You are free to close this PR, or let me know if I should.