code: private void finish(String requestId, boolean removeTask) {
          String script = "";
          if (removeTask) {
             script +=  "local scheduled = redis.call('zscore', KEYS[5], ARGV[3]);"
                      + "if scheduled == false then "
                          + "redis.call('hdel', KEYS[4], ARGV[3]); "
                      + "end;";
          }
          script += "redis.call('zrem', KEYS[5], 'ff' .. ARGV[3]);" +
                    "if redis.call('decr', KEYS[1]) == 0 then "
                     + "redis.call('del', KEYS[1]);"
                      + "if redis.call('get', KEYS[2]) == ARGV[1] then "
                          + "redis.call('del', KEYS[6]);"
                          + "redis.call('set', KEYS[2], ARGV[2]);"
                          + "redis.call('publish', KEYS[3], ARGV[2]);"
                      + "end;"
                  + "end;";  
  
          commandExecutor.evalWrite(name, StringCodec.INSTANCE, RedisCommands.EVAL_VOID,
                  script,
                  Arrays.<Object>asList(tasksCounterName, statusName, terminationTopicName, tasksName, schedulerQueueName, tasksRetryIntervalName),
                  RedissonExecutorService.SHUTDOWN_STATE, RedissonExecutorService.TERMINATED_STATE, requestId);
      }
docs: Check shutdown state. If tasksCounter equals <code>0</code>
  and executor in <code>shutdown</code> state, then set <code>terminated</code> state
  and notify terminationTopicName
  <p>
  If <code>scheduledRequestId</code> is not null then
  delete scheduled task
  
  @param requestId