@@ -470,19 +470,19 @@ public void run() {
470470 // Those result sets will trigger initiateProduceRows() when the first results are received.
471471 // Non-streaming result sets do not trigger this callback, and for those result sets, we
472472 // need to eagerly start the ProduceRowsRunnable.
473- synchronized (monitor ) {
474- if (state == State .STREAMING_IN_PROGRESS
475- || state == State .RUNNING
476- || state == State .CONSUMING ) {
477- return ;
478- }
479- if (state == State .STREAMING_INITIALIZED ) {
480- state = State .STREAMING_IN_PROGRESS ;
481- }
473+ // synchronized (monitor) {
474+ // if (state == State.STREAMING_IN_PROGRESS
475+ // || state == State.RUNNING
476+ // || state == State.CONSUMING) {
477+ // return;
478+ // }
479+ // if (state == State.STREAMING_INITIALIZED) {
480+ // state = State.STREAMING_IN_PROGRESS;
481+ // }
482482 if (!initiateStreaming (AsyncResultSetImpl .this )) {
483483 initiateProduceRows ();
484484 }
485- }
485+ // }
486486 } catch (Throwable exception ) {
487487 executionException = SpannerExceptionFactory .asSpannerException (exception );
488488 initiateProduceRows ();
@@ -511,7 +511,7 @@ public ApiFuture<Void> setCallback(Executor exec, ReadyCallback cb) {
511511
512512 private void initiateProduceRows () {
513513 synchronized (monitor ) {
514- if (this .state == State .STREAMING_IN_PROGRESS ) {
514+ if (this .state == State .STREAMING_INITIALIZED ) {
515515 this .state = State .RUNNING ;
516516 }
517517 produceRowsInitiated = true ;
@@ -662,7 +662,7 @@ public void onStreamMessage(PartialResultSet partialResultSet, boolean bufferIsF
662662 !partialResultSet .getResumeToken ().isEmpty ()
663663 || bufferIsFull
664664 || partialResultSet == GrpcStreamIterator .END_OF_STREAM ;
665- if (startJobThread || state != State .STREAMING_IN_PROGRESS ) {
665+ if (startJobThread || state != State .STREAMING_INITIALIZED ) {
666666 initiateProduceRows ();
667667 }
668668 }
0 commit comments