Skip to content

Commit 7c869a5

Browse files
Add more logs
1 parent fa7025d commit 7c869a5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

google-cloud-spanner/src/main/java/com/google/cloud/spanner/AsyncResultSetImpl.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,11 +470,14 @@ public void run() {
470470
// Non-streaming result sets do not trigger this callback, and for those result sets, we
471471
// need to eagerly start the ProduceRowsRunnable.
472472
synchronized (monitor) {
473-
if (state == State.STREAMING_STARTED || state == State.RUNNING || state == State.CONSUMING) {
473+
if (state == State.STREAMING_STARTED
474+
|| state == State.RUNNING
475+
|| state == State.CONSUMING) {
474476
return;
475477
}
476-
state = State.STREAMING_STARTED;
477-
System.out.printf("State: %s\n", state);
478+
if (state == State.STREAMING_INITIALIZED) {
479+
state = State.STREAMING_STARTED;
480+
}
478481
if (!initiateStreaming(AsyncResultSetImpl.this)) {
479482
initiateProduceRows();
480483
}
@@ -657,7 +660,7 @@ public void onStreamMessage(PartialResultSet partialResultSet, boolean bufferIsF
657660
!partialResultSet.getResumeToken().isEmpty()
658661
|| bufferIsFull
659662
|| partialResultSet == GrpcStreamIterator.END_OF_STREAM;
660-
if (startJobThread || state != State.STREAMING_INITIALIZED) {
663+
if (startJobThread || state != State.STREAMING_STARTED) {
661664
initiateProduceRows();
662665
}
663666
}

0 commit comments

Comments
 (0)