Repository navigation
Conversation
--aggregator-port and --master-port on `traceml run` are capped at 65535, but `traceml serve --aggregator-port 70000` still read the flag with a bare int() and crashed inside the aggregator with "OverflowError: bind(): port must be 0-65535." after creating the run directory. The dashboard port had no range check on any path: with --dashboard-port 70000, TRACEML_DASHBOARD_PORT=70000 or dashboard_port: 70000 in traceml.yaml, `traceml run --mode dashboard` printed an access box for http://127.0.0.1:70000, then the aggregator died with "OverflowError: connect_ex(): port must be 0-65535." and training finished without telemetry and with exit code 0. serve now builds its aggregator address through AggregatorLaunchConfig, so it reports the same "[TraceML] ERROR: --aggregator-port must be <= 65535" as run and exits 1. dashboard_port is checked against 1..65535 for the CLI flag, the env var and traceml.yaml, matching how finalize_timeout_sec is validated on all three sources, and a config error raised while resolving env vars for `traceml run` now exits with the message instead of a traceback.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Every port TraceML accepts is now checked against 1..65535 before anything is created or started:
traceml serve --aggregator-portgoes through the launcher'sAggregatorLaunchConfig(the same validatortraceml runuses since Reject out-of-range ports in launch arguments #545), soserve --aggregator-port 70000prints[TraceML] ERROR: --aggregator-port must be <= 65535and exits 1, and--aggregator-port 0is rejected withmust be >= 1instead of binding an ephemeral port.dashboard_portis range-checked on all three sources, following thefinalize_timeout_secpattern from Reject non-positive finalize_timeout_sec from traceml.yaml and env #540:--dashboard-portinvalidate_launch_args,TRACEML_DASHBOARD_PORTin_coerce_env, anddashboard_port:intraceml.yamlin_validate_and_coerce, via a sharedis_valid_port()/MAX_PORTinyaml_loader.ValueErrorraised whilelaunch_processresolves config from env vars is now reported as[TraceML] ERROR: ...with exit code 1, the same way thetraceml.yamlerrors next to it already are, instead of a raw traceback.Fixes #548
Why
#545 capped
--master-port/--aggregator-portfortraceml run, but_resolve_serve_settingsread the aggregator port with a bareint(), sotraceml serve --aggregator-port 70000still created the run directory and then crashed withOverflowError: bind(): port must be 0-65535.The dashboard port had no range check anywhere:traceml run --mode dashboard --dashboard-port 70000(or the env var, ortraceml.yaml) printed an access box forhttp://127.0.0.1:70000, the aggregator died onconnect_ex()with the sameOverflowError, training ran without telemetry, and the command exited 0. A typo in a port should fail fast with the flag name, not degrade telemetry mid-run.How I tested
New tests (all fail on
version_0.5.1without the fix, 15 failures; pass with it):tests/runtime/test_launcher.py:test_serve_rejects_out_of_range_aggregator_port(65536 and 0, assertsrun_aggregatoris never called),test_validate_rejects_out_of_range_dashboard_port(0, -1, 65536, 70000),test_validate_accepts_highest_dashboard_port,test_run_rejects_out_of_range_dashboard_port_env_before_launch(exit 1, message on stderr, no manifest or process side effects).tests/config/test_yaml_loader.py:test_load_yaml_config_rejects_out_of_range_dashboard_port,test_load_yaml_config_accepts_highest_dashboard_port,test_resolve_config_rejects_out_of_range_dashboard_port_env.Manual smoke test, before and after, with a trivial
train.py:Runtime impact
Notes: Launcher-side argument and config validation only. Valid ports resolve to exactly the same
TraceMLSettingsas before;servekeeps its127.0.0.1defaults for connect and bind host (AggregatorLaunchConfigwith a defaultTorchrunLaunchConfigyields the same values). No sampler, transport, aggregator or reporting code changes.Docs
examples/README.mdshows--dashboard-port=9000and does not state a range; the error messages carry the bound.Extra context
The 1..65535 bound on the dashboard side lives in
yaml_loaderasMAX_PORT/is_valid_port()next tois_finite_positive(), sincedashboard_portis a yaml-owned UI setting, whileservereuses the typed launch config that already owns the aggregator address. Happy to fold the two helpers together if you would rather have a single port validator.