-
Notifications
You must be signed in to change notification settings - Fork 59
Thread blocked - getConnection #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think it’s because the mysql driver does not use the async DNS API of Netty.
you can open an issue in this repo about it
… On Mar 13, 2017, at 11:31 PM, Leonardo Silva ***@***.***> wrote:
Hi guys,
I faced this issue when trying to access a database, but my internet is really slow so it is taking some seconds to successfully establish a new connection, the problem is that it is blocking the main-thread.
Checking the error and the code I found something and would like to understand better:
AsyncConnectionPool.java (line 63)
connection
.connect().onComplete(ScalaUtils.toFunction1(handler), VertxEventLoopExecutionContext.create(vertx));
Looks like this is using the current context to wait for the connection, right?
The stacktrace:
io.vertx.core.VertxException: Thread blocked
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
at java.net.InetAddress.getAllByName0(InetAddress.java:1276)
at java.net.InetAddress.getAllByName(InetAddress.java:1192)
at java.net.InetAddress.getAllByName(InetAddress.java:1126)
at java.net.InetAddress.getByName(InetAddress.java:1076)
at java.net.InetSocketAddress.<init>(InetSocketAddress.java:220)
at com.github.mauricio.async.db.mysql.codec.MySQLConnectionHandler.connect(MySQLConnectionHandler.scala:87)
at com.github.mauricio.async.db.mysql.MySQLConnection.connect(MySQLConnection.scala:84)
at io.vertx.ext.asyncsql.impl.pool.AsyncConnectionPool.createConnection(AsyncConnectionPool.java:63)
at io.vertx.ext.asyncsql.impl.pool.AsyncConnectionPool.createOrWaitForAvailableConnection(AsyncConnectionPool.java:77)
at io.vertx.ext.asyncsql.impl.pool.AsyncConnectionPool.take(AsyncConnectionPool.java:86)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#69>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AANxii266pWMmdXdhl-KRd-tW84NJ740ks5rlcPdgaJpZM4Mb5se>.
|
@vietj, would not be good just to use another execution service from our side? or run this in a executeBlocking just like we do with jdbc-async? |
I believe it would be easier to use the io.vertx.core.impl.AddressResolver and then directly use the resolved InetSocketAddress |
@vietj I can check this when have some time if needed, just need to understand better the integration |
https://thoeni.io/post/macos-sierra-java/ this solution! |
Hi guys,
I faced this issue when trying to access a database, but my internet is really slow so it is taking some seconds to successfully establish a new connection, the problem is that it is blocking the main-thread.
Checking the error and the code I found something and would like to understand better:
AsyncConnectionPool.java (line 63)
Looks like this is using the current context to wait for the connection, right?
The stacktrace:
The text was updated successfully, but these errors were encountered: