Replaces apiserver's hand-written Go parsePeer() with a CGO wrapper around the shared C parser+validator pair (xce_parse_peers then xce_cluster_config_validate, both src/lib/cluster.c) that worker and scheduler already use from their own main.c's. Gives apiserver the same [name=]host:port[,...] syntax (including the name= prefix the old Go parser could not express) and identical malformed-candidate rejection (empty host, port <= 0, non-numeric port) -- round-1 review caught the first pass skipping the validate() half, silently accepting inputs worker/scheduler both reject. A malformed entry now rejects the whole candidate list rather than being skipped with a warning (matches xce_parse_peers()'s own all-or-nothing construction and worker/scheduler's precedent) -- surfaced loudly via RegisterToBackend's error, not silently. Parsing only -- RegisterToBackend()'s connect loop and tryConnect() are unchanged; collapsing them into a single connect call is task 4.2's job. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NNB4zGPCsHyDUCDJyMbiQN |
||
|---|---|---|
| .. | ||
| backend | ||
| cmd | ||
| common | ||
| config | ||
| controllers | ||
| docs | ||
| middleware | ||
| models | ||
| router | ||
| services | ||
| store | ||
| tools/encrypt | ||
| utils | ||
| go.mod | ||
| go.sum | ||
| meson.build | ||
| README.md | ||
(1) run server command:
cd cmd go run main.go
(2) run server with different log level: cd cmd go run main.go -level=debug
level options: info/debug/warn/error/fatal