Skip to content

Commit e79e037

Browse files
authored
Include command type in the timeout message (#3167)
It is very frustrating to get a stacktrace which does not indicate which command has failed when using async/reactive clients.
1 parent 0ccdde3 commit e79e037

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/io/lettuce/core/protocol/CommandExpiryWriter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ private void potentiallyExpire(RedisCommand<?, ?, ?> command, ScheduledExecutorS
179179

180180
Timeout commandTimeout = timer.newTimeout(t -> {
181181
if (!command.isDone()) {
182-
executors.submit(() -> command.completeExceptionally(
183-
ExceptionFactory.createTimeoutException(Duration.ofNanos(timeUnit.toNanos(timeout)))));
182+
executors.submit(() -> command.completeExceptionally(ExceptionFactory
183+
.createTimeoutException(command.getType().toString(), Duration.ofNanos(timeUnit.toNanos(timeout)))));
184184

185185
}
186186
}, timeout, timeUnit);

0 commit comments

Comments
 (0)