Skip to content

Commit

Permalink
[SPARK-49930][SS] Ensure that socket updates are flushed on exception…
Browse files Browse the repository at this point in the history
… from the python worker

### What changes were proposed in this pull request?
Ensure that socket updates are flushed on exception from the python worker

### Why are the changes needed?
Without this, updates to the socket from the python worker are not delivered to the jvm side

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
Existing tests were failing on a different Python version and pass after

```
Run completed in 1 minute, 13 seconds.
Total number of tests run: 8
Suites: completed 1, aborted 0
Tests: succeeded 8, failed 0, canceled 0, ignored 0, pending 0
All tests passed.
```

### Was this patch authored or co-authored using generative AI tooling?
No

Closes apache#48418 from anishshri-db/task/SPARK-49930.

Authored-by: Anish Shrigondekar <anish.shrigondekar@databricks.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
  • Loading branch information
anishshri-db authored and HyukjinKwon committed Oct 12, 2024
1 parent 04ec55e commit 3ecfe8e
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ def main(infile: IO, outfile: IO) -> None:
reader.stop()
except BaseException as e:
handle_worker_exception(e, outfile)
# ensure that the updates to the socket are flushed
outfile.flush()
sys.exit(-1)
send_accumulator_updates(outfile)

Expand Down

0 comments on commit 3ecfe8e

Please sign in to comment.