HyukjinKwon opened a new pull request, #423:
URL: https://github.com/apache/spark-connect-rust/pull/423

   ### What changes were proposed in this pull request?
   
   A follow-up of 
[SPARK-61219](https://issues.apache.org/jira/browse/SPARK-61219) (#402), which 
made `spark.stop()` release the session before it cancels the listener bus, so 
that the terminated events of the queries still running reach the listeners, as 
PySpark's do.
   
   Its live test, 
`test_a_query_running_at_stop_sends_its_terminated_event_to_the_listeners_as_pyspark`,
 waited for the terminated event of a `rate` query that was running at 
`stop()`. Whether the server sends that event is not under the client's 
control: the server posts it through its asynchronous listener bus while it 
releases the session, and the release can end the listener stream first. The 
test failed in the CI of unrelated PRs (#411, #413: no event within 120 s).
   
   This replaces it with a deterministic test of the client's part, in 
`streaming_listener_cases.py`: the mock server (`_mock_connect_server.py`, new 
opt-in `release_session_events` and `release_session_blocked`) sends a 
terminated event on the session's listener stream while it handles 
`ReleaseSession`, and holds the release's response until the listener got the 
event.
   
   ### Why are the changes needed?
   
   The live test was flaky in CI and failed the `Connect parity` job of 
unrelated PRs.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No, tests only.
   
   ### How was this patch tested?
   
   - The new test passes in 5 of 5 runs with master's build, and fails with a 
build of master whose `stop()` cancels the listener bus before the release (the 
order before SPARK-61219).
   - The listener tests of the offline suite (`-k "listener or Listener or 
stop"`, 67) pass, also under pytest 9.2 for the stop tests.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Opus 5.5
   
   This pull request and its description were written by Isaac.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to