You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/07/24 16:21:22 UTC

[GitHub] [geode] ringles commented on a change in pull request #5349: GEODE-8333: Fix PUBSUB hang

ringles commented on a change in pull request #5349:
URL: https://github.com/apache/geode/pull/5349#discussion_r460149939



##########
File path: geode-redis/src/main/java/org/apache/geode/redis/internal/netty/ExecutionHandlerContext.java
##########
@@ -191,38 +199,121 @@ public void channelInactive(ChannelHandlerContext ctx) {
     ctx.close();
   }
 
-  private void executeCommand(ChannelHandlerContext ctx, Command command) {
-    RedisResponse response;
-
-    if (!isAuthenticated()) {
-      response = handleUnAuthenticatedCommand(command);
-      writeToChannel(response);
-      return;
+  private void startAsyncCommandExecution(Command command) {
+    if (logger.isDebugEnabled()) {
+      logger.debug("Starting execution of async Redis command: {}", command);
     }
+    final long start = redisStats.startCommand(command.getCommandType());
+    command.setAsyncStartTime(start);
+    command.execute(this);
+  }
 
-    if (command.isUnsupported() && !allowUnsupportedCommands()) {
-      writeToChannel(
-          RedisResponse.error(command.getCommandType() + RedisConstants.ERROR_UNSUPPORTED_COMMAND));
-      return;
+  public void endAsyncCommandExecution(Command command, ByteBuf response) {
+    synchronized (commandQueue) {
+      Command head = takeFromCommandQueue();
+      if (head != command) {
+        throw new IllegalStateException(
+            "expected " + command + " but found " + head + " in the queue");

Review comment:
       Is there a test for this exception?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org