changgyoopark-db commented on code in PR #47955:
URL: https://github.com/apache/spark/pull/47955#discussion_r1745055938


##########
sql/connect/server/src/test/scala/org/apache/spark/sql/connect/execution/ReattachableExecuteSuite.scala:
##########
@@ -429,4 +429,21 @@ class ReattachableExecuteSuite extends 
SparkConnectServerTest {
     val abandonedExecutions = manager.listAbandonedExecutions
     assert(abandonedExecutions.forall(_.operationId != dummyOpId))
   }
+
+  test("SPARK-49492: reattach succeeds on an inactive execution holder") {
+    val dummyOpId = UUID.randomUUID().toString
+    val dummyRequest =
+      buildExecutePlanRequest(buildPlan("select * from range(1)"), operationId 
= dummyOpId)
+    val manager = SparkConnectService.executionManager
+    val holder = manager.createExecuteHolder(dummyRequest)
+    holder.eventsManager.postStarted()
+    manager.removeExecuteHolder(holder.key)
+    withRawBlockingStub { stub =>
+      val reattach = 
stub.reattachExecute(buildReattachExecuteRequest(dummyOpId, None))
+      val e = intercept[StatusRuntimeException] {
+        reattach.hasNext()
+      }
+      assert(e.getMessage.contains("INVALID_HANDLE.OPERATION_NOT_FOUND"))
+    }
+  }

Review Comment:
   Thanks, I'll try that!



-- 
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-unsubscr...@spark.apache.org

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


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

Reply via email to