Skip to content

build(server): take all of kore to 0.1.14 under one version ref - #58

Merged
youndie merged 2 commits into
mainfrom
build/kore-0.1.14
Oct 2, 2026
Merged

youndie merged 2 commits into
mainfrom
build/kore-0.1.14

Conversation

@youndie

@youndie youndie commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Takes every kore module and the kore.build plugin to 0.1.14 under one kore version ref; koreMcp is gone. The lifecycle moves to the 0.1.9+ wiring (kotlin-skills native-service-bootstrap, step 6):

  • startForKore() instead of start(wait = false). On the JVM start left Ktor's own shutdown hook on, which stops the engine at the signal, mid-announce (On the JVM, Ktor's own shutdown hook stops the engine at SIGTERM, before kore's announce kore#90); on Kotlin/Native a SIGTERM right after start could hang the process (kore B-63). The 0.1.14 EngineDrain refuses to be built beside an armed hook.
  • The 503 refusal reads a DrainGate, the same instance EngineDrain opens as its first act, instead of readiness — which falls at the start of the announce and so refused exactly the requests the announce wait is for (kore B-61). The deprecated predicate form is gone (warnings are errors here).
  • reuseAddress = true on the engine, and the HTTP port checked before start with kore's requireListenable and the same flag: a busy METRIK_HTTP_PORT is now one line naming the variable and exit code 1, not a native crash (kore B-59, B-62). metrik reads its environment by hand, so the check gets a one-key schema fed the already-parsed port rather than the process environment — kore's schema refuses undeclared variables under its prefix, and the kubelet injects METRIK_METRIK_* service variables into the pod.
  • MetrikProbes.stop() calls stopAndJoin() (HealthRegistry.stop() cannot be waited on, so a check can outlive what it checks kore#79), so the stage waits for a check in flight.

Also in this PR, because it failed the first CI run: AgentLossReportingTest and MetrikPluginTest iterated the recording sender's ArrayList while the agent appended to it from its own thread (ConcurrentModificationException on the JVM). Both senders now keep the list under a Mutex and hand out a copy.

Docs in the same change: BACKLOG.md M-114, the METRIK_HTTP_PORT row in docs/services/metrik-server.md.

Verification

  • :server:jvmTest and :server:linuxX64Test green on a Linux host, compile with no kore deprecation warnings. New HttpPortCheckTest: a port something listens on is a ConfigurationException naming METRIK_HTTP_PORT (JVM and linuxX64).

  • Ktor unchanged: every io.ktor in :server:dependencies --configuration linuxX64CompileKlibraries resolves to 3.6.0, as before; the only arrows are the MCP SDK's 3.5.1 → 3.6.0, same as on main.

  • Image built from this branch, docker stop under load (/api/services every 50 ms), side by side with the image of main (sha-d7031e2):

    SIGTERM → drain (announce, 2 s) after the drain exit
    main 503 × 33 in a row connection refused by itself, 0
    this branch 200 throughout, no 503 connection refused by itself, 0

    Transcript on this branch:

    SIGNAL COMPLETED in 1.453us
    ANNOUNCE COMPLETED in 2.000108022s
    DRAIN COMPLETED in 605.686us
    RELEASE_CONSUMERS COMPLETED in 32.704us
    RELEASE_POOLS COMPLETED in 3.629358ms
    RELEASE_TELEMETRY COMPLETED in 154.749us
    EXIT COMPLETED in 527ns
    
  • A second process in the first one's network namespace: main — Uncaught Kotlin exception … AddressAlreadyInUseException, exit 139; this branch — METRIK_HTTP_PORT: 8080 cannot be listened on: bind: Address already in use (errno 98), exit 1.

Not covered: the UDP ingest port has the same failure class and kore's check is TCP-only — #57.

Closes #56

kore-core, kore-ktor and the build plugin stayed on 0.1.4 while kore-mcp rode 0.1.14 on its own ref, because the newer EngineDrain refuses to run beside Ktor's own shutdown hook. The lifecycle now uses the 0.1.9+ wiring: startForKore, one DrainGate shared by the refusal and the drain, reuseAddress with a pre-start check of the HTTP port, and stopAndJoin on the health registry.

Closes #56
The agent sends from its own thread while the test iterated the same ArrayList, which failed CI with ConcurrentModificationException on the JVM. Both recording senders now guard the list with a Mutex and hand out a copy.
@youndie
youndie merged commit b2d268d into main Oct 2, 2026
1 check passed
@youndie
youndie deleted the build/kore-0.1.14 branch October 2, 2026 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Поднять kore целиком до 0.1.14: startForKore, DrainGate и остальное после 0.1.4

1 participant