Skip to content

Commit

Permalink
fix infinate print null point exception for trace bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wbzj1110 committed Apr 2, 2021
1 parent ba6e81c commit 160f9ab
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/io/lettuce/core/protocol/CommandHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,15 @@ private void writeSingleCommand(ChannelHandlerContext ctx, RedisCommand<?, ?, ?>
span.tag("redis.args", command.getArgs().toCommandString());
}

span.remoteEndpoint(tracedEndpoint);
if (tracedEndpoint != null) {
span.remoteEndpoint(tracedEndpoint);
} else {
span.remoteEndpoint(clientResources.tracing().createEndpoint(ctx.channel().remoteAddress()));
}
span.start();
provider.setSpan(span);
if (provider != null) {
provider.setSpan(span);
}

CompleteableCommand<?> completeableCommand = (CompleteableCommand<?>) command;
completeableCommand.onComplete((o, throwable) -> {
Expand Down

0 comments on commit 160f9ab

Please sign in to comment.