dongjoon-hyun opened a new pull request, #616: URL: https://github.com/apache/spark-connect-swift/pull/616
### What changes were proposed in this pull request? This PR aims to send the final `ReleaseExecute(release_all)` of reattachable executions in a best-effort way, like the Scala and Python clients. Previously, it was sent inside the reattach loop right after `ResultComplete` arrived, so its failure was handled like a broken response stream. Now, it is sent after the loop by the existing `releaseAll(_:)` helper, which already ignores failures when an execution is abandoned after an error. ### Why are the changes needed? `ReleaseExecute` only asks the server to free the buffered responses, and the server removes abandoned executions by itself after `spark.connect.execute.manager.detachedTimeout` (5 minutes by default). However, its failure failed the whole execution even after all responses were received and processed. - `INVALID_HANDLE.SESSION_NOT_FOUND`, e.g., after the server restarted, was reported as `invalidState: OPERATION_NOT_FOUND on the server but responses were already received from it.` - `INVALID_HANDLE.SESSION_CLOSED`, e.g., after another task released the session, was thrown as `sessionClosed`. - Only retriable errors like `UNAVAILABLE` succeeded, after a needless backoff sleep. Since `collect()`, `count()`, and the command APIs like `DataFrameWriter.save()` use this path, a finished write could be reported as failed, and retrying it could repeat its side effects. The Scala and Python clients send this request asynchronously and only log its failure. ### Does this PR introduce _any_ user-facing change? No for the released versions because the reattachable execution (SPARK-58543) is not released yet. The latest release is [0.7.0](https://github.com/apache/spark-connect-swift/releases/tag/0.7.0) (2026-07-25). In the `main` branch, executions which received all responses no longer fail when the final `ReleaseExecute` fails. ### How was this patch tested? Pass the CIs with the newly added test case, `ReattachableExecuteTests.releaseAllFailureAfterResultComplete`. It releases the session with `ReleaseSession` when `ResultComplete` arrives, so that the final `ReleaseExecute` fails with `SESSION_NOT_FOUND` (`allow_reconnect=true`, like after a server restart) and `SESSION_CLOSED`. Without this fix, the test case fails like the following. ``` Test releaseAllFailureAfterResultComplete() recorded an issue at ReattachableExecuteTests.swift:130:4: Caught error: invalidState: OPERATION_NOT_FOUND on the server but responses were already received from it. ``` ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 5.5 -- 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]
