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 2020/11/24 09:56:45 UTC

[GitHub] [shardingsphere] xzpoul opened a new issue #8318: MySQLErrPacket NullPointerException

xzpoul opened a new issue #8318:
URL: https://github.com/apache/shardingsphere/issues/8318


   ## Bug Report
   
   **When 100 threads insert data into a table, Proxy keep throwing NullPointerException.**
   
   **java.lang.NullPointerException: null**
   	at org.apache.shardingsphere.shardingproxy.frontend.mysql.MySQLErrPacketFactory.newInstance(MySQLErrPacketFactory.java:50)
   	at org.apache.shardingsphere.shardingproxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.createErrorPacket(MySQLComQueryPacketExecutor.java:86)
   	at org.apache.shardingsphere.shardingproxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:76)
   	at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:93)
   	at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:71)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   	at java.lang.Thread.run(Thread.java:748)
   ### Which version of ShardingSphere did you use?
   4.1.0
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
    ShardingSphere-Proxy
   ### Expected behavior
   no error
   ### Actual behavior
    NullPointerException
   ### Reason analyze (If you can)
    
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   tables:
     CUSTOMER_INFO:
       actualDataNodes: ds0.CUSTOMER_INFO
       logicTable: CUSTOMER_INFO
     CUSTOMER_CARD:
       actualDataNodes: ds0.CUSTOMER_CARD
       keyGenerator:
         column: CARD_NO
         type: SNOWFLAKE
       logicTable: CUSTOMER_CARD
   ds0: !!org.apache.shardingsphere.orchestration.core.configuration.YamlDataSourceConfiguration
     dataSourceClassName: com.zaxxer.hikari.HikariDataSource
     properties:
       jdbcUrl: jdbc:mysql://192.168.11.11:3306/test?serverTimezone=UTC&useSSL=false
       username: 123
       password: 123
       connectionTimeout: 30000
       idleTimeout: 60000
       maxLifetime: 1800000
       maxPoolSize: 50
       minPoolSize: 1
       maintenanceIntervalMilliseconds: 30000
       readOnly: false
   
   ### Example codes for reproduce this issue (such as a github link).
   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] xzpoul edited a comment on issue #8318: MySQLErrPacket NullPointerException

Posted by GitBox <gi...@apache.org>.
xzpoul edited a comment on issue #8318:
URL: https://github.com/apache/shardingsphere/issues/8318#issuecomment-733587093


   Hi @tuohai666 
   When I insert 100 threads, I now see two phenomena. One is that during the insertion process, null pointer exceptions occur once or twice.
   At this point it seems to be in a blocking state, with the CPU close to 0%. Table data is not growing either.After a while, it inserts normally.
   The other is to keep throwing null Pointers.At this point, Instead of using 1 thread insert, the null pointer will also be reported.
   But if the Proxy is restarted, 1 thread is fine.
   
   1.
   The shardingAlgorithmName is not used because it is a data source
   
   2.
   ```
   CREATE TABLE `customer_info` (
     `SYSID` bigint(20) NOT NULL AUTO_INCREMENT,
     `NAME_C` varchar(100) DEFAULT NULL,
     `NAME_P` varchar(100) DEFAULT NULL,
     `NAME_E` varchar(100) DEFAULT NULL,
     `GENDER` char(1) DEFAULT NULL,
     `CARDTYPE` char(4) DEFAULT NULL,
     `IDCARD` char(20) DEFAULT NULL,
     `MOBILE` char(20) DEFAULT NULL,
     `OFFICEPHONE` char(20) DEFAULT NULL,
     `HOMEPHONE` char(20) DEFAULT NULL,
     `MAILADDRESS` varchar(200) DEFAULT NULL,
     `HOMEADDRESS` varchar(200) DEFAULT NULL,
     `OFFICEADDRESS` varchar(200) DEFAULT NULL,
     `FLAG` char(1) DEFAULT 'Y',
     `OPENDATE` timestamp NULL DEFAULT NULL,
     `CLOSEDATE` timestamp NULL DEFAULT NULL,
     `MEMO` varchar(400) DEFAULT NULL,
     `CURMEM` int(11) DEFAULT NULL,
     `UPDATETIME` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
     PRIMARY KEY (`SYSID`),
     KEY `CUSTOMER_INFO_UPDATETIME_IDX` (`UPDATETIME`)
   ) ENGINE=InnoDB AUTO_INCREMENT=220149 DEFAULT CHARSET=utf8mb4;
   
   CREATE TABLE `customer_card` (
     `SYSID` bigint(20) DEFAULT NULL,
     `NAME_P` varchar(100) DEFAULT NULL,
     `C_NO` bigint(20) NOT NULL AUTO_INCREMENT,
     `OPENDATE` timestamp NULL DEFAULT NULL,
     `TYPE` char(3) DEFAULT 'BNK',
     `EXPDATE` timestamp NULL DEFAULT NULL,
     `ACCOUNT` decimal(19,3) DEFAULT NULL,
     `CURMEM` smallint(6) DEFAULT NULL,
     `UPDATETIME` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
     PRIMARY KEY (`C_NO`),
     KEY `CUS_SYSID_IDX` (`SYSID`),
     KEY `UPDATETIME_IDX` (`UPDATETIME`)
   ) ENGINE=InnoDB AUTO_INCREMENT=538209984702316545 DEFAULT CHARSET=utf8mb4; 
   ```
   
   [INFO ] 03:40:00.155 [ShardingSphere-Command-14] ShardingSphere-SQL - 
   Actual SQL: ds0 ::: insert into CUSTOMER_INFO(SYSID, NAME_C, 
   name_p, name_e, gender, cardtype, idcard, mobile,
    officephone, homephone, mailaddress, homeaddress, 
    officeaddress, flag, opendate) values(220148, 'JKU', 
    'S', 'STS', 'F', 'NC', 10003853, '13810982345', 
    '01082312342', '01023231232', 'ixu@zcom', 
    'back log', 
   'max_connect_errors', 'Y', '2020-11-25 16:39:59.937');
   
   3.
   ```
   executor.size: 16
   allow.range.query.with.inline.sharding: false
   proxy.transaction.type: LOCAL
   sql.show: true
   proxy.opentracing.enabled: false
   query.with.cipher.column: false
   proxy.frontend.flush.threshold: 128
   acceptor.size: 16
   max.connections.size.per.query: 1
   proxy.hint.enabled: false
   
   
   tables:
     CUSTOMER_INFO:
       actualDataNodes: ds0.CUSTOMER_INFO
       logicTable: CUSTOMER_INFO
     CUSTOMER_CARD:
       actualDataNodes: ds0.CUSTOMER_CARD
       keyGenerator:
         column: CARD_NO
         type: SNOWFLAKE
       logicTable: CUSTOMER_CARD
   
   ds0: !!org.apache.shardingsphere.orchestration.core.configuration.YamlDataSourceConfiguration
     dataSourceClassName: com.zaxxer.hikari.HikariDataSource
     properties:
       jdbcUrl: jdbc:mysql://192.168.11.11:3306/test?serverTimezone=UTC&useSSL=false
       username: 123
       password: 123
       connectionTimeout: 30000
       idleTimeout: 60000
       maxLifetime: 1800000
       maxPoolSize: 50
       minPoolSize: 1
       maintenanceIntervalMilliseconds: 30000
       readOnly: false
   ```
   4.
   ![image](https://user-images.githubusercontent.com/45033859/100209122-7446a300-2f44-11eb-92a2-1ba4a15a61b0.png)
   
   ![image](https://user-images.githubusercontent.com/45033859/100210066-8248f380-2f45-11eb-9e13-809dbd2a91b0.png)
   
   
   
   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] xzpoul commented on issue #8318: MySQLErrPacket NullPointerException

Posted by GitBox <gi...@apache.org>.
xzpoul commented on issue #8318:
URL: https://github.com/apache/shardingsphere/issues/8318#issuecomment-734103216


   @tuohai666 
   # version 5.0.0
   # proxy.transaction.type: LOCAL 
   # Error:
   ![image](https://user-images.githubusercontent.com/45033859/100315457-a6630e00-2ff3-11eb-8529-9339bf26d180.png)
   
   # proxy.transaction.type: XA
   # No Error.
   
   # What should I do to optimize configuration with LOCAL?


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] xzpoul edited a comment on issue #8318: MySQLErrPacket NullPointerException

Posted by GitBox <gi...@apache.org>.
xzpoul edited a comment on issue #8318:
URL: https://github.com/apache/shardingsphere/issues/8318#issuecomment-734103216


   @tuohai666 
    version 5.0.0
    proxy.transaction.type: LOCAL 
    Error:
   ![image](https://user-images.githubusercontent.com/45033859/100315457-a6630e00-2ff3-11eb-8529-9339bf26d180.png)
   
   proxy.transaction.type: XA
    No Error.
   
   ## What should I do to optimize configuration with LOCAL?


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] tuohai666 commented on issue #8318: MySQLErrPacket NullPointerException

Posted by GitBox <gi...@apache.org>.
tuohai666 commented on issue #8318:
URL: https://github.com/apache/shardingsphere/issues/8318#issuecomment-733503299


   Hi @xzpoul If the thread count is 1, will this exception fire?
   
   1. What is the shardingAlgorithmName?
   2. Please provide the SQL.
   3. Please provide server.yaml file.
   4. Please set sql.show: true and provide the log.


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] tuohai666 closed issue #8318: MySQLErrPacket NullPointerException

Posted by GitBox <gi...@apache.org>.
tuohai666 closed issue #8318:
URL: https://github.com/apache/shardingsphere/issues/8318


   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] tuohai666 commented on issue #8318: MySQLErrPacket NullPointerException

Posted by GitBox <gi...@apache.org>.
tuohai666 commented on issue #8318:
URL: https://github.com/apache/shardingsphere/issues/8318#issuecomment-733619329


   @xzpoul The exception was most likely an MySQL server error exception.
   
   I compared the codes between 4.1.0 with 5.0.0, and found that the former may burst Unknown exception while the latter will throw the Exception same as MySQL server.
   
   To find out the cause of this exception, I suggest updating the Proxy to 5.0.0 version.
   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] xzpoul commented on issue #8318: MySQLErrPacket NullPointerException

Posted by GitBox <gi...@apache.org>.
xzpoul commented on issue #8318:
URL: https://github.com/apache/shardingsphere/issues/8318#issuecomment-733587093


   
   When I insert 100 threads, I now see two phenomena. One is that during the insertion process, null pointer exceptions occur once or twice.
   At this point it seems to be in a blocking state, with the CPU close to 0%. Table data is not growing either.After a while, it inserts normally.
   The other is to keep throwing null Pointers.At this point, Instead of using 1 thread insert, the null pointer will also be reported.
   But if the Proxy is restarted, 1 thread is fine.
   
   1.
   The shardingAlgorithmName is not used because it is a data source
   
   2.
   ```
   CREATE TABLE `customer_info` (
     `SYSID` bigint(20) NOT NULL AUTO_INCREMENT,
     `NAME_C` varchar(100) DEFAULT NULL,
     `NAME_P` varchar(100) DEFAULT NULL,
     `NAME_E` varchar(100) DEFAULT NULL,
     `GENDER` char(1) DEFAULT NULL,
     `CARDTYPE` char(4) DEFAULT NULL,
     `IDCARD` char(20) DEFAULT NULL,
     `MOBILE` char(20) DEFAULT NULL,
     `OFFICEPHONE` char(20) DEFAULT NULL,
     `HOMEPHONE` char(20) DEFAULT NULL,
     `MAILADDRESS` varchar(200) DEFAULT NULL,
     `HOMEADDRESS` varchar(200) DEFAULT NULL,
     `OFFICEADDRESS` varchar(200) DEFAULT NULL,
     `FLAG` char(1) DEFAULT 'Y',
     `OPENDATE` timestamp NULL DEFAULT NULL,
     `CLOSEDATE` timestamp NULL DEFAULT NULL,
     `MEMO` varchar(400) DEFAULT NULL,
     `CURMEM` int(11) DEFAULT NULL,
     `UPDATETIME` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
     PRIMARY KEY (`SYSID`),
     KEY `CUSTOMER_INFO_UPDATETIME_IDX` (`UPDATETIME`)
   ) ENGINE=InnoDB AUTO_INCREMENT=220149 DEFAULT CHARSET=utf8mb4;
   
   CREATE TABLE `customer_card` (
     `SYSID` bigint(20) DEFAULT NULL,
     `NAME_P` varchar(100) DEFAULT NULL,
     `C_NO` bigint(20) NOT NULL AUTO_INCREMENT,
     `OPENDATE` timestamp NULL DEFAULT NULL,
     `TYPE` char(3) DEFAULT 'BNK',
     `EXPDATE` timestamp NULL DEFAULT NULL,
     `ACCOUNT` decimal(19,3) DEFAULT NULL,
     `CURMEM` smallint(6) DEFAULT NULL,
     `UPDATETIME` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
     PRIMARY KEY (`C_NO`),
     KEY `CUS_SYSID_IDX` (`SYSID`),
     KEY `UPDATETIME_IDX` (`UPDATETIME`)
   ) ENGINE=InnoDB AUTO_INCREMENT=538209984702316545 DEFAULT CHARSET=utf8mb4; 
   ```
   
   [INFO ] 03:40:00.155 [ShardingSphere-Command-14] ShardingSphere-SQL - 
   Actual SQL: ds0 ::: insert into CUSTOMER_INFO(SYSID, NAME_C, 
   name_p, name_e, gender, cardtype, idcard, mobile,
    officephone, homephone, mailaddress, homeaddress, 
    officeaddress, flag, opendate) values(220148, '署', 
    'S', 'STS', 'F', 'NC', 10003853, '13810982345', 
    '01082312342', '01023231232', 'ixu@zcom', 
    'back log', 
   'max_connect_errors', 'Y', '2020-11-25 16:39:59.937');
   
   3.
   ```
   executor.size: 16
   allow.range.query.with.inline.sharding: false
   proxy.transaction.type: LOCAL
   sql.show: true
   proxy.opentracing.enabled: false
   query.with.cipher.column: false
   proxy.frontend.flush.threshold: 128
   acceptor.size: 16
   max.connections.size.per.query: 1
   proxy.hint.enabled: false
   
   
   tables:
     CUSTOMER_INFO:
       actualDataNodes: ds0.CUSTOMER_INFO
       logicTable: CUSTOMER_INFO
     CUSTOMER_CARD:
       actualDataNodes: ds0.CUSTOMER_CARD
       keyGenerator:
         column: CARD_NO
         type: SNOWFLAKE
       logicTable: CUSTOMER_CARD
   
   ds0: !!org.apache.shardingsphere.orchestration.core.configuration.YamlDataSourceConfiguration
     dataSourceClassName: com.zaxxer.hikari.HikariDataSource
     properties:
       jdbcUrl: jdbc:mysql://192.168.11.11:3306/test?serverTimezone=UTC&useSSL=false
       username: 123
       password: 123
       connectionTimeout: 30000
       idleTimeout: 60000
       maxLifetime: 1800000
       maxPoolSize: 50
       minPoolSize: 1
       maintenanceIntervalMilliseconds: 30000
       readOnly: false
   ```
   4.
   ![image](https://user-images.githubusercontent.com/45033859/100209122-7446a300-2f44-11eb-92a2-1ba4a15a61b0.png)
   
   ![image](https://user-images.githubusercontent.com/45033859/100209174-845e8280-2f44-11eb-8f41-826aee43de0c.png)
   
   
   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] tuohai666 commented on issue #8318: MySQLErrPacket NullPointerException

Posted by GitBox <gi...@apache.org>.
tuohai666 commented on issue #8318:
URL: https://github.com/apache/shardingsphere/issues/8318#issuecomment-734113300


   @xzpoul This exception shows that there are not enough connections available. You can simply change maxPoolSize to 100 or more to solve this problem. But please make sure that your MySQL server instance can afford this concurrency.


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] xzpoul edited a comment on issue #8318: MySQLErrPacket NullPointerException

Posted by GitBox <gi...@apache.org>.
xzpoul edited a comment on issue #8318:
URL: https://github.com/apache/shardingsphere/issues/8318#issuecomment-733587093


   Hi @tuohai666 
   When I insert 100 threads, I now see two phenomena. One is that during the insertion process, null pointer exceptions occur once or twice.
   At this point it seems to be in a blocking state, with the CPU close to 0%. Table data is not growing either.After a while, it inserts normally.
   The other is to keep throwing null Pointers.At this point, Instead of using 1 thread insert, the null pointer will also be reported.
   But if the Proxy is restarted, 1 thread is fine.
   
   1.
   The shardingAlgorithmName is not used because it is a data source
   
   2.
   ```
   CREATE TABLE `customer_info` (
     `SYSID` bigint(20) NOT NULL AUTO_INCREMENT,
     `NAME_C` varchar(100) DEFAULT NULL,
     `NAME_P` varchar(100) DEFAULT NULL,
     `NAME_E` varchar(100) DEFAULT NULL,
     `GENDER` char(1) DEFAULT NULL,
     `CARDTYPE` char(4) DEFAULT NULL,
     `IDCARD` char(20) DEFAULT NULL,
     `MOBILE` char(20) DEFAULT NULL,
     `OFFICEPHONE` char(20) DEFAULT NULL,
     `HOMEPHONE` char(20) DEFAULT NULL,
     `MAILADDRESS` varchar(200) DEFAULT NULL,
     `HOMEADDRESS` varchar(200) DEFAULT NULL,
     `OFFICEADDRESS` varchar(200) DEFAULT NULL,
     `FLAG` char(1) DEFAULT 'Y',
     `OPENDATE` timestamp NULL DEFAULT NULL,
     `CLOSEDATE` timestamp NULL DEFAULT NULL,
     `MEMO` varchar(400) DEFAULT NULL,
     `CURMEM` int(11) DEFAULT NULL,
     `UPDATETIME` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
     PRIMARY KEY (`SYSID`),
     KEY `CUSTOMER_INFO_UPDATETIME_IDX` (`UPDATETIME`)
   ) ENGINE=InnoDB AUTO_INCREMENT=220149 DEFAULT CHARSET=utf8mb4;
   
   CREATE TABLE `customer_card` (
     `SYSID` bigint(20) DEFAULT NULL,
     `NAME_P` varchar(100) DEFAULT NULL,
     `C_NO` bigint(20) NOT NULL AUTO_INCREMENT,
     `OPENDATE` timestamp NULL DEFAULT NULL,
     `TYPE` char(3) DEFAULT 'BNK',
     `EXPDATE` timestamp NULL DEFAULT NULL,
     `ACCOUNT` decimal(19,3) DEFAULT NULL,
     `CURMEM` smallint(6) DEFAULT NULL,
     `UPDATETIME` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
     PRIMARY KEY (`C_NO`),
     KEY `CUS_SYSID_IDX` (`SYSID`),
     KEY `UPDATETIME_IDX` (`UPDATETIME`)
   ) ENGINE=InnoDB AUTO_INCREMENT=538209984702316545 DEFAULT CHARSET=utf8mb4; 
   ```
   
   [INFO ] 03:40:00.155 [ShardingSphere-Command-14] ShardingSphere-SQL - 
   Actual SQL: ds0 ::: insert into CUSTOMER_INFO(SYSID, NAME_C, 
   name_p, name_e, gender, cardtype, idcard, mobile,
    officephone, homephone, mailaddress, homeaddress, 
    officeaddress, flag, opendate) values(220148, '署', 
    'S', 'STS', 'F', 'NC', 10003853, '13810982345', 
    '01082312342', '01023231232', 'ixu@zcom', 
    'back log', 
   'max_connect_errors', 'Y', '2020-11-25 16:39:59.937');
   
   3.
   ```
   executor.size: 16
   allow.range.query.with.inline.sharding: false
   proxy.transaction.type: LOCAL
   sql.show: true
   proxy.opentracing.enabled: false
   query.with.cipher.column: false
   proxy.frontend.flush.threshold: 128
   acceptor.size: 16
   max.connections.size.per.query: 1
   proxy.hint.enabled: false
   
   
   tables:
     CUSTOMER_INFO:
       actualDataNodes: ds0.CUSTOMER_INFO
       logicTable: CUSTOMER_INFO
     CUSTOMER_CARD:
       actualDataNodes: ds0.CUSTOMER_CARD
       keyGenerator:
         column: CARD_NO
         type: SNOWFLAKE
       logicTable: CUSTOMER_CARD
   
   ds0: !!org.apache.shardingsphere.orchestration.core.configuration.YamlDataSourceConfiguration
     dataSourceClassName: com.zaxxer.hikari.HikariDataSource
     properties:
       jdbcUrl: jdbc:mysql://192.168.11.11:3306/test?serverTimezone=UTC&useSSL=false
       username: 123
       password: 123
       connectionTimeout: 30000
       idleTimeout: 60000
       maxLifetime: 1800000
       maxPoolSize: 50
       minPoolSize: 1
       maintenanceIntervalMilliseconds: 30000
       readOnly: false
   ```
   4.
   ![image](https://user-images.githubusercontent.com/45033859/100209122-7446a300-2f44-11eb-92a2-1ba4a15a61b0.png)
   
   ![image](https://user-images.githubusercontent.com/45033859/100209174-845e8280-2f44-11eb-8f41-826aee43de0c.png)
   
   
   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] xzpoul edited a comment on issue #8318: MySQLErrPacket NullPointerException

Posted by GitBox <gi...@apache.org>.
xzpoul edited a comment on issue #8318:
URL: https://github.com/apache/shardingsphere/issues/8318#issuecomment-733587093


   Hi @tuohai666 
   When I insert 100 threads, I now see two phenomena. One is that during the insertion process, null pointer exceptions occur once or twice.
   At this point it seems to be in a blocking state, with the CPU close to 0%. Table data is not growing either.After a while, it inserts normally.
   The other is to keep throwing null Pointers.At this point, Instead of using 1 thread insert, the null pointer will also be reported.
   But if the Proxy is restarted, 1 thread is fine.
   
   1.
   The shardingAlgorithmName is not used because it is a data source
   
   2.
   ```
   CREATE TABLE `customer_info` (
     `SYSID` bigint(20) NOT NULL AUTO_INCREMENT,
     `NAME_C` varchar(100) DEFAULT NULL,
     `NAME_P` varchar(100) DEFAULT NULL,
     `NAME_E` varchar(100) DEFAULT NULL,
     `GENDER` char(1) DEFAULT NULL,
     `CARDTYPE` char(4) DEFAULT NULL,
     `IDCARD` char(20) DEFAULT NULL,
     `MOBILE` char(20) DEFAULT NULL,
     `OFFICEPHONE` char(20) DEFAULT NULL,
     `HOMEPHONE` char(20) DEFAULT NULL,
     `MAILADDRESS` varchar(200) DEFAULT NULL,
     `HOMEADDRESS` varchar(200) DEFAULT NULL,
     `OFFICEADDRESS` varchar(200) DEFAULT NULL,
     `FLAG` char(1) DEFAULT 'Y',
     `OPENDATE` timestamp NULL DEFAULT NULL,
     `CLOSEDATE` timestamp NULL DEFAULT NULL,
     `MEMO` varchar(400) DEFAULT NULL,
     `CURMEM` int(11) DEFAULT NULL,
     `UPDATETIME` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
     PRIMARY KEY (`SYSID`),
     KEY `CUSTOMER_INFO_UPDATETIME_IDX` (`UPDATETIME`)
   ) ENGINE=InnoDB AUTO_INCREMENT=220149 DEFAULT CHARSET=utf8mb4;
   
   CREATE TABLE `customer_card` (
     `SYSID` bigint(20) DEFAULT NULL,
     `NAME_P` varchar(100) DEFAULT NULL,
     `C_NO` bigint(20) NOT NULL AUTO_INCREMENT,
     `OPENDATE` timestamp NULL DEFAULT NULL,
     `TYPE` char(3) DEFAULT 'BNK',
     `EXPDATE` timestamp NULL DEFAULT NULL,
     `ACCOUNT` decimal(19,3) DEFAULT NULL,
     `CURMEM` smallint(6) DEFAULT NULL,
     `UPDATETIME` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
     PRIMARY KEY (`C_NO`),
     KEY `CUS_SYSID_IDX` (`SYSID`),
     KEY `UPDATETIME_IDX` (`UPDATETIME`)
   ) ENGINE=InnoDB AUTO_INCREMENT=538209984702316545 DEFAULT CHARSET=utf8mb4; 
   ```
   
   [INFO ] 03:40:00.155 [ShardingSphere-Command-14] ShardingSphere-SQL - 
   Actual SQL: ds0 ::: insert into CUSTOMER_INFO(SYSID, NAME_C, 
   name_p, name_e, gender, cardtype, idcard, mobile,
    officephone, homephone, mailaddress, homeaddress, 
    officeaddress, flag, opendate) values(220148, '署', 
    'S', 'STS', 'F', 'NC', 10003853, '13810982345', 
    '01082312342', '01023231232', 'ixu@zcom', 
    'back log', 
   'max_connect_errors', 'Y', '2020-11-25 16:39:59.937');
   
   3.
   ```
   executor.size: 16
   allow.range.query.with.inline.sharding: false
   proxy.transaction.type: LOCAL
   sql.show: true
   proxy.opentracing.enabled: false
   query.with.cipher.column: false
   proxy.frontend.flush.threshold: 128
   acceptor.size: 16
   max.connections.size.per.query: 1
   proxy.hint.enabled: false
   
   
   tables:
     CUSTOMER_INFO:
       actualDataNodes: ds0.CUSTOMER_INFO
       logicTable: CUSTOMER_INFO
     CUSTOMER_CARD:
       actualDataNodes: ds0.CUSTOMER_CARD
       keyGenerator:
         column: CARD_NO
         type: SNOWFLAKE
       logicTable: CUSTOMER_CARD
   
   ds0: !!org.apache.shardingsphere.orchestration.core.configuration.YamlDataSourceConfiguration
     dataSourceClassName: com.zaxxer.hikari.HikariDataSource
     properties:
       jdbcUrl: jdbc:mysql://192.168.11.11:3306/test?serverTimezone=UTC&useSSL=false
       username: 123
       password: 123
       connectionTimeout: 30000
       idleTimeout: 60000
       maxLifetime: 1800000
       maxPoolSize: 50
       minPoolSize: 1
       maintenanceIntervalMilliseconds: 30000
       readOnly: false
   ```
   4.
   ![image](https://user-images.githubusercontent.com/45033859/100209122-7446a300-2f44-11eb-92a2-1ba4a15a61b0.png)
   
   ![image](https://user-images.githubusercontent.com/45033859/100210066-8248f380-2f45-11eb-9e13-809dbd2a91b0.png)
   
   
   
   


----------------------------------------------------------------
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.

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