Skip to content
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

ConnectionWatchdog throws NullPointerException when connection drops (Redisson 2.5.0) #671

Closed
johnou opened this issue Oct 18, 2016 · 4 comments
Labels

Comments

@johnou
Copy link
Contributor

johnou commented Oct 18, 2016

When restarting the Redis server all connection threads logged the following exception.

2016-10-18 12:45:59,686 ERROR [redisson-netty-1-1] (org.redisson.client.handler.CommandsQueue) Exception occured. Channel: [id: 0xa23d4302, L:0.0.0.0/0.0.0.0:42732 ! R:xxxxxxxxxxxxxx]
java.lang.NullPointerException: null
    at org.redisson.client.handler.ConnectionWatchdog.reconnect(ConnectionWatchdog.java:88) ~[redisson-2.5.0.jar:?]
    at org.redisson.client.handler.ConnectionWatchdog.channelInactive(ConnectionWatchdog.java:75) ~[redisson-2.5.0.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:251) [netty-transport-4.0.42.Final.jar:4.0.42.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:237) [netty-transport-4.0.42.Final.jar:4.0.42.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:230) [netty-transport-4.0.42.Final.jar:4.0.42.Final]
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1289) [netty-transport-4.0.42.Final.jar:4.0.42.Final]

After the connection "interruption" the application starts logging the following..

2016-10-18 13:10:34,676 ERROR [globalEventExecutor-2-1] (org.redisson.connection.ElasticacheConnectionManager) Command execution timeout for xxxxxxxxxxxx
org.redisson.client.RedisTimeoutException: Command execution timeout for xxxxxxxxxxx
    at org.redisson.client.RedisConnection.await(RedisConnection.java:126) ~[redisson-2.5.0.jar:?]
    at org.redisson.client.RedisConnection.sync(RedisConnection.java:158) ~[redisson-2.5.0.jar:?]
    at org.redisson.client.RedisConnection.sync(RedisConnection.java:144) ~[redisson-2.5.0.jar:?]
    at org.redisson.connection.ElasticacheConnectionManager$1.run(ElasticacheConnectionManager.java:134) [redisson-2.5.0.jar:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_102]
    at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:126) [netty-common-4.0.42.Final.jar:4.0.42.Final]
    at io.netty.util.concurrent.GlobalEventExecutor$TaskRunner.run(GlobalEventExecutor.java:237) [netty-common-4.0.42.Final.jar:4.0.42.Final]
    at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144) [netty-common-4.0.42.Final.jar:4.0.42.Final]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_102]

The host resolves to the same IP so that isn't a problem and I am able to telnet and issue the replication command without problems (immediate response)..

Escape character is '^]'.
INFO replication
$178
# Replication
role:master
connected_slaves:0
master_repl_offset:0
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0
@johnou johnou changed the title ConnectionWatchdog throws NullPointerException ConnectionWatchdog throws NullPointerException (Redisson 2.5.0) Oct 18, 2016
@johnou johnou changed the title ConnectionWatchdog throws NullPointerException (Redisson 2.5.0) ConnectionWatchdog throws NullPointerException Oct 18, 2016
@johnou johnou changed the title ConnectionWatchdog throws NullPointerException ConnectionWatchdog throws NullPointerException (Redisson 2.5.0) Oct 18, 2016
@johnou johnou changed the title ConnectionWatchdog throws NullPointerException (Redisson 2.5.0) ConnectionWatchdog throws NullPointerException when connection drops (Redisson 2.5.0) Oct 18, 2016
@johnou
Copy link
Contributor Author

johnou commented Oct 18, 2016

org.redisson.connection.MasterSlaveConnectionManager#init is called after org.redisson.connection.MasterSlaveConnectionManager#createClient(java.lang.String, int, int, int) so a null timer is passed right down the chain into ConnectionWatchdog..

@johnou
Copy link
Contributor Author

johnou commented Oct 18, 2016

Might be enough just to move init(this.config); in org.redisson.connection.ElasticacheConnectionManager#ElasticacheConnectionManager before the iteration over node addresses.

@mrniko
Copy link
Member

mrniko commented Oct 18, 2016

Please rebase your fix on master and send PR for RedisClient again.

@johnou
Copy link
Contributor Author

johnou commented Oct 18, 2016

@mrniko PTAL #673

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants