question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

3.8.4 | vertx-pg-client | io.vertx.core.VertxException: closed

See original GitHub issue

I have a floating bug configuration:

var config = new PgConnectOptions()
                .setDatabase(properties.getProperty("PGDBNAME"))
                .setHost(properties.getProperty("PGHOST"))
                .setPort(Integer.parseInt(properties.getProperty("PGPORT")))
                .setReconnectAttempts(1)
                .setReconnectInterval(10)
                .setProperties(conProps)
                .setIdleTimeout(10);
var poolConfig = new PoolOptions()
                .setMaxSize(20);
return PgPool.pool(config, poolConfig);

Error occurs after 10 seconds (IdleTimeout), but in the db logs I do not see such long queries trace:

Caused by: io.vertx.core.VertxException: closed
	at io.vertx.pgclient.impl.codec.PgCodec.channelInactive(PgCodec.java:56)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:236)
	at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:81)
	at io.netty.handler.timeout.IdleStateHandler.channelInactive(IdleStateHandler.java:278)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:236)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1417)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243)
	at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:913)
	at io.netty.channel.AbstractChannel$AbstractUnsafe$8.run(AbstractChannel.java:819)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:510)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:518)
	at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1050)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:834)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
vietjcommented, Jan 6, 2020

this setIdleTimeout(10 is for inactive connections, not for queries

0reactions
estet90commented, Jan 14, 2020

ah for bug I mean that you might be having a bug where the client is not performing the query at all

yes, most likely it is

Read more comments on GitHub >

github_iconTop Results From Across the Web

io.vertx.core.VertxException: Connection was closed #4813
It looks like when the HTTP Client is used, following messages start appearing in the logs: 2021-04-24 23:02:43 ERROR HttpClientRequestImpl: ...
Read more >
Vert.x - How to know which connection was closed
The io.vertx.core.VertxException: Connection was closed can be triggered for both client connections and server connections.
Read more >
httpClient throws VertxException: Connection was closed
I make a proxy style service and I use vertex http client in worker verticle for using http request to the other server....
Read more >
eclipse-vertx/vertx-users - Gitter
@vietj I'm looking into "io.vertx.core.VertxException: Connection was closed" in our live service on vert.x 3.8.2. It looks to me that vert.x might not ......
Read more >
VertxException "Connection was closed" when using HttpClient
When using HttpClient, every time the connection is closed then exception is always thrown in exceptionHandler.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found