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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to