jonmeredith commented on code in PR #2104:
URL: https://github.com/apache/cassandra/pull/2104#discussion_r1083133165
##########
src/java/org/apache/cassandra/streaming/StreamResultFuture.java:
##########
@@ -239,8 +239,14 @@ private synchronized void maybeComplete()
StreamState finalState = getCurrentState();
if (finalState.hasFailedSession())
{
- logger.warn("[Stream #{}] Stream failed", planId);
- tryFailure(new StreamException(finalState, "Stream failed"));
+ StringBuilder stringBuilder = new StringBuilder();
+ for (SessionInfo info : finalState.getAllSessionInfo())
+ {
+ if (info.isFailed())
+ stringBuilder.append("\nSession peer
").append(info.peer).append(info.failurereason);
+ }
+ logger.warn("[Stream #{}] Stream failed: {}", planId,
stringBuilder);
+ tryFailure(new StreamException(finalState, "Stream failed: " +
stringBuilder));
Review Comment:
nit: Doesn't really matter for performance as not called frequently, but you
could include the common `"String failed:"` in the string builder. Could also
convert to something like `String message = stringBuilder.toString();`, rather
than calling toString twice and allocating two String objects.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]