Skip to content

[SYSTEMDS-3959] Report an error when a federated worker cannot bind its port - #2586

Open
gaturchenko wants to merge 1 commit into
apache:mainfrom
gaturchenko:fed-worker-invalid-port
Open

[SYSTEMDS-3959] Report an error when a federated worker cannot bind its port#2586
gaturchenko wants to merge 1 commit into
apache:mainfrom
gaturchenko:fed-worker-invalid-port

Conversation

@gaturchenko

Copy link
Copy Markdown
Contributor

The command systemds WORKER 80505 terminated silently with exit code 0. There are 2 causes:

  1. No range check for -w <port>
  2. FederatedWorker.run() captured every exception in a catch-all. The same held for occupied and reserved ports, and for the -fedMonitoring backend

The following changes were implemented:

  • PortUtils (new): shared port validation plus explainBindFailure, which turns terse socket errors into messages naming the port and the cause.
  • DMLOptions: -w and -fedMonitoring reject non-integers and ports outside [1, 65535]. A missing (optional) -w argument now falls back to the default port instead of throwing NumberFormatException.
  • FederatedWorker / FederatedMonitoringServer: reject out-of-range ports upfront, warn on reserved ports (< 1024), and throw bind failures as DMLRuntimeException after logging.
  • bin/systemds: the duplicated WORKER/FEDMONITORING check is now one checkPort function with a range check and exit 1. Previously, an error was printed and the JVM was launched regardless.

@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 47.16981% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.43%. Comparing base (9dccbc3) to head (1362487).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...rc/main/java/org/apache/sysds/utils/PortUtils.java 42.30% 10 Missing and 5 partials ⚠️
...ederated/monitoring/FederatedMonitoringServer.java 15.38% 7 Missing and 4 partials ⚠️
...time/controlprogram/federated/FederatedWorker.java 71.42% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2586      +/-   ##
============================================
- Coverage     71.44%   71.43%   -0.01%     
- Complexity    50437    50444       +7     
============================================
  Files          1629     1630       +1     
  Lines        195513   195559      +46     
  Branches      38118    38128      +10     
============================================
+ Hits         139686   139703      +17     
- Misses        44867    44877      +10     
- Partials      10960    10979      +19     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant