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.

Replayed activation commands may fail because of their execution sequence

See original GitHub issue

Bug Report

StatefulRedisPubSubConnectionImpl logs a warning: SELECT failed: ERR only (P)SUBSCRIBE / (P)UNSUBSCRIBE / PING / QUIT allowed in this context when repeatedly reconnecting in a short period of time (due to redis server restart). I assume this is a bug. Lettuce should be smart enough to not issue commands in the wrong order.

Current Behavior

Most relevant logs
Apr 01 08:32:49 [lettuce-eventExecutorLoop-1-3] INFO io.lettuce.core.protocol.ConnectionWatchdog - Reconnecting, last destination was myredis/149.28.236.118:6378
Apr 01 08:32:49 [lettuce-nioEventLoop-4-3] INFO io.lettuce.core.protocol.ReconnectionHandler - Reconnected to myredis:6378
Apr 01 08:33:04 [lettuce-eventExecutorLoop-1-3] INFO io.lettuce.core.protocol.ConnectionWatchdog - Reconnecting, last destination was myredis:6378
Apr 01 08:33:05 [lettuce-nioEventLoop-4-3] WARN io.lettuce.core.protocol.ConnectionWatchdog - Cannot reconnect to [myredis:6378]: Connection refused: myredis/149.28.236.118:6378
Apr 01 08:33:09 [lettuce-eventExecutorLoop-1-3] INFO io.lettuce.core.protocol.ConnectionWatchdog - Reconnecting, last destination was myredis:6378
Apr 01 08:33:09 [lettuce-nioEventLoop-4-3] INFO io.lettuce.core.protocol.ReconnectionHandler - Reconnected to myredis:6378
Apr 01 08:33:09 [lettuce-nioEventLoop-4-3] WARN io.lettuce.core.pubsub.StatefulRedisPubSubConnectionImpl - SELECT failed: ERR only (P)SUBSCRIBE / (P)UNSUBSCRIBE / PING / QUIT allowed in this context
Full logs
Apr 01 08:30:42 [ReredisConnection-1] INFO io.lettuce.core.EpollProvider - Starting without optional epoll library
Apr 01 08:30:42 [ReredisConnection-1] INFO io.lettuce.core.KqueueProvider - Starting without optional kqueue library
Apr 01 08:32:49 [lettuce-eventExecutorLoop-1-1] INFO io.lettuce.core.protocol.ConnectionWatchdog - Reconnecting, last destination was myredis/149.28.236.118:6378
Apr 01 08:32:49 [lettuce-eventExecutorLoop-1-2] INFO io.lettuce.core.protocol.ConnectionWatchdog - Reconnecting, last destination was myredis/149.28.236.118:6378
Apr 01 08:32:49 [lettuce-eventExecutorLoop-1-3] INFO io.lettuce.core.protocol.ConnectionWatchdog - Reconnecting, last destination was myredis/149.28.236.118:6378
Apr 01 08:32:49 [lettuce-nioEventLoop-4-1] INFO io.lettuce.core.protocol.ReconnectionHandler - Reconnected to myredis:6378
Apr 01 08:32:49 [lettuce-nioEventLoop-4-3] INFO io.lettuce.core.protocol.ReconnectionHandler - Reconnected to myredis:6378
Apr 01 08:32:49 [lettuce-nioEventLoop-4-2] INFO io.lettuce.core.protocol.ReconnectionHandler - Reconnected to myredis:6378
Apr 01 08:33:04 [lettuce-eventExecutorLoop-1-2] INFO io.lettuce.core.protocol.ConnectionWatchdog - Reconnecting, last destination was myredis:6378
Apr 01 08:33:04 [lettuce-eventExecutorLoop-1-3] INFO io.lettuce.core.protocol.ConnectionWatchdog - Reconnecting, last destination was myredis:6378
Apr 01 08:33:04 [lettuce-eventExecutorLoop-1-1] INFO io.lettuce.core.protocol.ConnectionWatchdog - Reconnecting, last destination was myredis:6378
Apr 01 08:33:05 [lettuce-nioEventLoop-4-2] WARN io.lettuce.core.protocol.ConnectionWatchdog - Cannot reconnect to [myredis:6378]: Connection refused: myredis/149.28.236.118:6378
Apr 01 08:33:05 [lettuce-nioEventLoop-4-3] WARN io.lettuce.core.protocol.ConnectionWatchdog - Cannot reconnect to [myredis:6378]: Connection refused: myredis/149.28.236.118:6378
Apr 01 08:33:05 [lettuce-nioEventLoop-4-1] WARN io.lettuce.core.protocol.ConnectionWatchdog - Cannot reconnect to [myredis:6378]: Connection refused: myredis/149.28.236.118:6378
Apr 01 08:33:09 [lettuce-eventExecutorLoop-1-2] INFO io.lettuce.core.protocol.ConnectionWatchdog - Reconnecting, last destination was myredis:6378
Apr 01 08:33:09 [lettuce-eventExecutorLoop-1-3] INFO io.lettuce.core.protocol.ConnectionWatchdog - Reconnecting, last destination was myredis:6378
Apr 01 08:33:09 [lettuce-eventExecutorLoop-1-1] INFO io.lettuce.core.protocol.ConnectionWatchdog - Reconnecting, last destination was myredis:6378
Apr 01 08:33:09 [lettuce-nioEventLoop-4-3] INFO io.lettuce.core.protocol.ReconnectionHandler - Reconnected to myredis:6378
Apr 01 08:33:09 [lettuce-nioEventLoop-4-2] INFO io.lettuce.core.protocol.ReconnectionHandler - Reconnected to myredis:6378
Apr 01 08:33:09 [lettuce-nioEventLoop-4-1] INFO io.lettuce.core.protocol.ReconnectionHandler - Reconnected to myredis:6378
Apr 01 08:33:09 [lettuce-nioEventLoop-4-3] WARN io.lettuce.core.pubsub.StatefulRedisPubSubConnectionImpl - SELECT failed: ERR only (P)SUBSCRIBE / (P)UNSUBSCRIBE / PING / QUIT allowed in this context

Input Code

Input Code
var uri = uri = RedisURI.builder()
	.withHost("myredis")
	.withPort(6378)
	.withSsl(true)
	.withPassword(Secrets.password("redis-password"))
	.withDatabase(10)
	.build();
var client = RedisClient.create();
var reads = client.connect(StringCodec.UTF8, uri);
var pubsub = client.connectPubSub(ByteArrayCodec.INSTANCE, uri);
var writes = client.connect(StringCodec.UTF8, uri);

Expected behavior/code

Instead of just silencing the warning (which I can do now), I would prefer to see a fix for whatever underlying bug is causing this.

Environment

  • Lettuce version(s): 5.2.2.RELEASE
  • Redis version: 5.0.5

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mp911decommented, Apr 2, 2020

That’s fixed now for 5.3.0 and 6.0.

0reactions
mp911decommented, Apr 2, 2020

In any case, it makes sense to not re-queue/replay activation commands.

Read more comments on GitHub >

github_iconTop Results From Across the Web

openwhisk/actions.md at master - GitHub
When an action exceeds its configured time limit, the activation record will indicate this error. See understanding the activation record for more details....
Read more >
Resolving Common Problems - AWS Data Pipeline
A pipeline that appears stuck in the PENDING status indicates that a pipeline has not yet been activated, or activation failed due to...
Read more >
Enable or disable macros in Microsoft 365 files
Enable or disable macros in Microsoft 365 files ... A macro is a series of commands that you can use to automate a...
Read more >
Ensuring Application Continuity - Oracle Help Center
Mutable functions cause a problem for replay because the results can change at replay. Consider sequence .NEXTVAL and SYSDATE , often used in...
Read more >
22 Debugging | Advanced R - Hadley Wickham
You may also want to refer to the official RStudio debugging ... To find the root cause of an error, you're going to...
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