OServer::run_cli ignores service.toml socket paths — falls back to defaults #69
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_blueprint#69
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Discovered by the #261 agent while bootstrapping
hero_service.The generated
_servermain.rscallsOServer::run_cli(lifecycle, ...)which is supposed to honor the socket path declared in the embeddedservice.toml. In practice it falls back to the default-derived path (HERO_SOCKET_DIR / service_name / rpc.sock), ignoring any custompathspecified under[[binaries.sockets]].For the standard case the result is fine (because the default matches the convention), but a service that legitimately needs a non-default socket path can't get it.
What to do
OServer::run_clisocket resolution inhero_rpc/crates/server/.service.tomlsocket entry first and only fall back to the default if not set.Acceptance
pathin[[binaries.sockets]]bind at the declared path.Related
Fix on
issue-69-oserver-socket-pathsThree commits (compare):
fix(server)—8617118— core fix.test(server)—17687b6— integration test incrates/server/tests/run_cli_socket_path.rs.chore(example)—564c4de— opt therecipe_serverexample into the new resolution.Root cause
OServer::run_cliconstructed anOServerConfigonly with the lifecycle'sservice_nameand bound atconfig.rpc_socket(&config.name)→$HERO_SOCKET_DIR/<service_name>/rpc.sock. It never readservice.toml, so a binary likepetstore_serverdeclaringpath = "hero_petstore/rpc.sock"was silently bound atpetstore_server/rpc.sockinstead.print_info_jsonhad the same bug — the--infoJSON descriptor reported the default path, not the declared one.Fix
HeroLifecycle::service_toml(toml_str)builder — attach the embedded manifest to the lifecycle.OServerConfig::rpc_socket_relative(rel)builder — override the rpc socket path.OServer::run_clinow parses the attachedservice.toml, finds the rpc socket entry (SockType::Rpc) for the matching binary, and propagatespathas the override. Falls back gracefully when no manifest is attached or no rpc socket is declared.print_info_jsonuses the same resolution.crates/server/src/server/server.rsand end-to-end in the new integration test.Acceptance
pathin[[binaries.sockets]]bind at the declared path (validated byrpc_socket_path_resolution::Case 1, plus a liverpc.healthrequest).rpc_socket_path_resolution::Case 2).cargo test -p hero_rpc_server -p hero_lifecycle: 21 + 8 + 1 + doctests, all green).