Aleksey-Terzi / CastleGates

Apache License 2.0
1 stars 8 forks source link

DB doesn't reconnect if connection dies #2

Closed ProgrammerDan closed 8 years ago

ProgrammerDan commented 8 years ago
[02:21:42 WARN]: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
[02:21:42 WARN]:        at sun.reflect.GeneratedConstructorAccessor175.newInstance(Unknown Source)
[02:21:42 WARN]:        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[02:21:42 WARN]:        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
[02:21:42 WARN]:        at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
[02:21:42 WARN]:        at com.mysql.jdbc.Util.getInstance(Util.java:387)
[02:21:42 WARN]:        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)
[02:21:42 WARN]:        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:898)
[02:21:42 WARN]:        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:887)
[02:21:42 WARN]:        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:862)
[02:21:42 WARN]:        at com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1237)
[02:21:42 WARN]:        at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1232)
[02:21:42 WARN]:        at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4131)
[02:21:42 WARN]:        at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4100)
[02:21:42 WARN]:        at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4107)
[02:21:42 WARN]:        at com.aleksey.castlegates.database.SqlDatabase.prepareStatementWithReturn(SqlDatabase.java:80)
[02:21:42 WARN]:        at com.aleksey.castlegates.database.LinkSource.insert(LinkSource.java:56)
[02:21:42 WARN]:        at com.aleksey.castlegates.utils.DataWorker.updateLinks(DataWorker.java:220)
[02:21:42 WARN]:        at com.aleksey.castlegates.utils.DataWorker.run(DataWorker.java:171)
[02:21:42 WARN]: Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 56,632,
982 milliseconds ago.  The last packet sent successfully to the server was 56,632,982 milliseconds ago. is longer than the server configured value of
'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configure
d values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
[02:21:42 WARN]:        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[02:21:42 WARN]:        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
[02:21:42 WARN]:        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[02:21:42 WARN]:        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
[02:21:42 WARN]:        at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
[02:21:42 WARN]:        at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:983)
[02:21:42 WARN]:        at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3644)
[02:21:42 WARN]:        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2452)
[02:21:42 WARN]:        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2617)
[02:21:42 WARN]:        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2550)
[02:21:42 WARN]:        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
[02:21:42 WARN]:        at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2073)
[02:21:42 WARN]:        at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2009)
[02:21:42 WARN]:        at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5094)
[02:21:42 WARN]:        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1994)
[02:21:42 WARN]:        at com.aleksey.castlegates.database.GearblockSource.insert(GearblockSource.java:57)
[02:21:42 WARN]:        at com.aleksey.castlegates.utils.DataWorker.updateGears(DataWorker.java:193)
[02:21:42 WARN]:        at com.aleksey.castlegates.utils.DataWorker.run(DataWorker.java:170)
[02:21:42 WARN]: Caused by: java.net.SocketException: Broken pipe
[02:21:42 WARN]:        at java.net.SocketOutputStream.socketWrite0(Native Method)
[02:21:42 WARN]:        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113)
[02:21:42 WARN]:        at java.net.SocketOutputStream.write(SocketOutputStream.java:159)
[02:21:42 WARN]:        at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
[02:21:42 WARN]:        at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
[02:21:42 WARN]:        at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3626)
[02:21:42 WARN]:        ... 11 more
ProgrammerDan commented 8 years ago

This is a pretty nasty bug, renders plugin unusable; a drawn in bridge is forever lost.

Aleksey-Terzi commented 8 years ago

Oh, will fix this today.

Aleksey-Terzi commented 8 years ago

Bug is reproduced and fixed.

Also I'm planning today-tomorrow to complete changes logging.