1

I am using vertx.io 3.6.3 and jasync-sql v 1.1.13 for mysql as lib to manage data persistence, The query at QA Env is fine but sometime I receive error message from lib like that :

{"@timestamp":"2020-07-15T06:36:46.933+00:00","level":"ERROR","logger_name":"com.github.jasync.sql.db.mysql.MySQLConnection","message":"<mysql-connection-14> Transport failure ","throwable_class":"IOException","stack_trace":"java.io.IOException: Connection timed out\n\tat sun.nio.ch.FileDispatcherImpl.read0(Native Method)\n\tat sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)\n\tat sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)\n\tat sun.nio.ch.IOUtil.read(IOUtil.java:192)\n\tat sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:377)\n\tat io.netty.buffer.UnpooledUnsafeDirectByteBuf.setBytes(UnpooledUnsafeDirectByteBuf.java:433)\n\tat io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1128)\n\tat io.netty.buffer.SwappedByteBuf.writeBytes(SwappedByteBuf.java:823)\n\tat io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:347)\n\tat io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148)\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)\n\tat io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)\n\tat

{"@timestamp":"2020-07-15T08:27:06.070+00:00","level":"DEBUG","logger_name":"com.github.jasync.sql.db.mysql.MySQLConnection","message":" - client got disconnected with no running query"}

I checked the mysql server at time exception happend, everything is ok.

Do can you suggest which way to solve it.

Thanks so much.

Trong Tran
  • 21
  • 5
  • did you check connection timeouts on mysql, it might cause this: https://stackoverflow.com/questions/14726789/how-can-i-change-the-default-mysql-connection-timeout-when-connecting-through-py – oshai Jul 15 '20 at 09:09
  • @oshai, Yes I checked it. I am using default configuration, same above – Trong Tran Jul 15 '20 at 13:22
  • so maybe it just timeout after the default has reached? – oshai Jul 15 '20 at 20:52
  • I think also, but how to ignore this log, ERROR log will trigger something not good. Could you please have some suggestion, I can not edit lib ? – Trong Tran Jul 15 '20 at 23:09
  • try to increase the connection timeout to something "infinite". – oshai Jul 15 '20 at 23:28
  • You means increase the wait_timeout = infinite ? – Trong Tran Jul 16 '20 at 01:32
  • Thanks mate but I dont have permission to change SET @@GLOBAL.wait_timeout=100000. – Trong Tran Jul 16 '20 at 01:51
  • That's unfortunate. vertx has it's own pool impl, it has a parameter `connectionReleaseDelay` try to set it to a number lower than the db timeout (it's in millis) – oshai Jul 16 '20 at 06:17
  • Thanks @oshai, I already try it today, let wait result :) – Trong Tran Jul 17 '20 at 01:39
  • Hi @oshai, Yesterday I meet this exception again. The exception happened after running load test. We run loast test from 10h -> 11h AM but exception timeout happend at 1h PM with no query/update anything. How do you think mate? – Trong Tran Aug 03 '20 at 02:04
  • It might be a bug in the pool, or something else I don't know. Try to reduce connectionReleaseDelay to 10000 ms and see if it's better. – oshai Aug 03 '20 at 05:37
  • Thanks @oshai mate for quick response ? if I reduce connectionReleaseDelay to 10k ms, did it impact to sql performance ? – Trong Tran Aug 03 '20 at 05:53
  • Hi @oshai, did you know why we have this exception : MySQLException","stack_trace":"com.github.jasync.sql.db.mysql.exceptions.MySQLException: Error 1568 - #25001 - Transaction characteristics can't be changed while a transaction is in progress. We already run load test after 1h. Server run 59 minutes ago ok but in the last minutes throw many exception of this – Trong Tran Aug 03 '20 at 15:06
  • I think it's better if we discuss this in [gitter](https://gitter.im//jasync-sql/support) – oshai Aug 03 '20 at 18:27

1 Answers1

1

vertx has it's own pool impl, it has a parameter connectionReleaseDelay try to set it to a number lower than the db timeout (it's in millis). Confirm it worked after I set connectionReleaseDelay = 600000 ms

Trong Tran
  • 21
  • 5