Replayed activation commands may fail because of their execution sequence
See original GitHub issueBug 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:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s fixed now for 5.3.0 and 6.0.
In any case, it makes sense to not re-queue/replay activation commands.