Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
3.5.6
-
None
-
None
Description
It seems there is NPE path in code of `MultiPrimaryReplicaClient`.
Precondition - when there was an issue with replica and
- `setReadOnly(true)` is called the inner state will be requestReadOnly=true, replicaClient=null, primaryClient != null
- when `setReadOnly(false)` is called later it will fail with NPE as replicaClient is null
```
java.lang.NullPointerException: Cannot invoke "org.mariadb.jdbc.client.Client.getContext()" because "oldCli" is null
at org.mariadb.jdbc.client.impl.MultiPrimaryClient.syncNewState(MultiPrimaryClient.java:299)
at org.mariadb.jdbc.client.impl.MultiPrimaryReplicaClient.setReadOnly(MultiPrimaryReplicaClient.java:294)
at org.mariadb.jdbc.Connection.setReadOnly(Connection.java:309)
```