myxce/src/frontend/apiserver
Rongsong Shen 8b1e13a52b
feat(component-failover-adoption): route apiserver's candidate parsing through the real C parser
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
2026-08-12 04:34:05 +00:00
..
backend feat(component-failover-adoption): route apiserver's candidate parsing through the real C parser 2026-08-12 04:34:05 +00:00
cmd feat: add HA candidate failover to API server backend 2026-05-08 03:31:35 +00:00
common Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
config fix(security): replace exposed admin credential with placeholder 2026-07-31 03:31:23 +00:00
controllers Merge branch 'working' into job_peek_lchen 2026-07-22 13:57:25 +08:00
docs Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
middleware Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
models fix: preserve admin-set host state across worker re-registration in makeWorker_ 2026-05-13 10:38:39 +00:00
router Init commit of jobs output/error message peek project. 2026-05-09 16:57:54 +08:00
services submit job from xcecli 2026-04-14 15:55:52 +08:00
store test(apiserver): add integration tests for P0+P1 backend features 2026-04-18 11:56:31 +00:00
tools/encrypt Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
utils refactor: simplify HA backend peer handling 2026-05-08 03:41:11 +00:00
go.mod Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
go.sum Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
meson.build Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
README.md Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00

(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