You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "juliuszsompolski (via GitHub)" <gi...@apache.org> on 2023/08/03 12:00:16 UTC

[GitHub] [spark] juliuszsompolski commented on a diff in pull request #42320: [SPARK-44656] Close Iterators in SparkResult as well.

juliuszsompolski commented on code in PR #42320:
URL: https://github.com/apache/spark/pull/42320#discussion_r1283101427


##########
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/connect/client/ExecutePlanResponseReattachableIterator.scala:
##########
@@ -52,7 +52,7 @@ class ExecutePlanResponseReattachableIterator(
     request: proto.ExecutePlanRequest,
     channel: ManagedChannel,
     retryPolicy: GrpcRetryHandler.RetryPolicy)
-    extends java.util.Iterator[proto.ExecutePlanResponse]
+    extends AutoConsumableIterator[proto.ExecutePlanResponse]

Review Comment:
   Consuming the iterator like AutoConsumableIterator does involve waiting for the execution to complete server side, and receiving all results from it. It may not be the intention of the user to wait for it when they abandon / close iterator.
   Closing the iterator here should involve first sending an Interrupt to the server, and then a ReleaseExecute request.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org