Skip to content

Commit

Permalink
add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
sakthivelmanii committed Jan 6, 2025
1 parent 6e25d40 commit 7bee9bd
Showing 1 changed file with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ abstract class ResumableStreamIterator extends AbstractIterator<PartialResultSet
private CloseableIterator<PartialResultSet> stream;
private ByteString resumeToken;
private boolean finished;
private final Object monitor = new Object();
/**
* Indicates whether it is currently safe to retry RPCs. This will be {@code false} if we have
* reached the maximum buffer size without seeing a restart token; in this case, we will drain the
Expand Down Expand Up @@ -318,17 +319,19 @@ && prepareIteratorForRetryOnDifferentGrpcChannel()) {
}

private void startGrpcStreaming() {
System.out.println("Starting Stream " + stream + " " + streamMessageListener);
if (stream == null) {
span.addAnnotation(
"Starting/Resuming stream",
"ResumeToken",
resumeToken == null ? "null" : resumeToken.toStringUtf8());
try (IScope scope = tracer.withSpan(span)) {
// When start a new stream set the Span as current to make the gRPC Span a child of
// this Span.
System.out.println("Creating Stream " + stream + " " + streamMessageListener);
stream = checkNotNull(startStream(resumeToken, streamMessageListener));
synchronized (monitor) {
System.out.println("Starting Stream " + stream + " " + streamMessageListener);
if (stream == null) {
span.addAnnotation(
"Starting/Resuming stream",
"ResumeToken",
resumeToken == null ? "null" : resumeToken.toStringUtf8());
try (IScope scope = tracer.withSpan(span)) {
// When start a new stream set the Span as current to make the gRPC Span a child of
// this Span.
System.out.println("Creating Stream " + stream + " " + streamMessageListener);
stream = checkNotNull(startStream(resumeToken, streamMessageListener));
}
}
}
}
Expand Down

0 comments on commit 7bee9bd

Please sign in to comment.