Commit 4ad5b3b
committed
fix: avoid py4j callback-server default-port (25334) collision
PythonCallback let py4j bind the hardcoded default callback port 25334, so
concurrent or repeated runs on the same host using a lambda-based Check failed
with "OSError: [Errno 98] Address already in use (127.0.0.1:25334)".
Force a dynamic (OS-assigned) port by setting the gateway's existing
callback_server_parameters to port=0 before starting the server the stock way.
Reusing PySpark's own parameters (rather than passing a fresh
CallbackServerParameters + resetCallbackClient) keeps the JVM callback client
correctly wired (no "Error while obtaining a new communication channel", #19)
and, crucially, lets shutdown_callback_server() return cleanly at teardown on
both Linux and macOS.
Closes #86, #19, #7, #72, #156, #173, #1981 parent 2e628b2 commit 4ad5b3b
2 files changed
Lines changed: 88 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
5 | 32 | | |
6 | 33 | | |
7 | 34 | | |
| |||
12 | 39 | | |
13 | 40 | | |
14 | 41 | | |
15 | | - | |
16 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
17 | 47 | | |
18 | 48 | | |
19 | 49 | | |
| 50 | + | |
| 51 | + | |
20 | 52 | | |
| 53 | + | |
21 | 54 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | 55 | | |
26 | 56 | | |
27 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
455 | 508 | | |
456 | 509 | | |
457 | 510 | | |
| |||
0 commit comments