You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2023/01/16 01:09:07 UTC

[GitHub] [shardingsphere] TeslaCN commented on issue #23018: java.lang.NullPointerException: Cannot invoke "org.apache.shardingsphere.proxy.backend.handler.ProxyBackendHandler.close()" because "this.proxyBackendHandler" is null

TeslaCN commented on issue #23018:
URL: https://github.com/apache/shardingsphere/issues/23018#issuecomment-1383319970

   > @TeslaCN @RaigorJiang I tried taking a stab at the issue. I think it is because of the delayed initialisation of the `proxyBackendHandler` in the [`MySQLComStmtExecuteExecutor`](https://github.com/apache/shardingsphere/blob/master/proxy/frontend/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/execute/MySQLComStmtExecuteExecutor.java#L81). The `proxyBackendHandler` variable is initialised only in the `execute()` method and if any exception is thrown before the initialisation, the `close` method will be called in the [`CommandExecutorTask`](https://github.com/apache/shardingsphere/blob/master/proxy/frontend/core/src/main/java/org/apache/shardingsphere/proxy/frontend/command/CommandExecutorTask.java#L123). We might have to check for the existence of the `proxyHandler` instance before invoking `close`.
   
   I don't think this is the root cause of the error. But it could be an enhancement. Would you like to submit a PR to eliminate the NPE?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org