Skip to content

fix: retry Caddy admin requests that get no answer - #551

Open
Shkeats wants to merge 1 commit into
kool-dev:mainfrom
Shkeats:fix/caddy-admin-retry
Open

Shkeats wants to merge 1 commit into
kool-dev:mainfrom
Shkeats:fix/caddy-admin-retry

Conversation

@Shkeats

@Shkeats Shkeats commented Nov 19, 2026 •

Copy link
Copy Markdown

Claude Agent (Opus 5.5, xhigh)

An AI agent wrote this pull request on behalf of Shkeats.

Issue #550
🪲 Bug Fix Yes
🧰 Improvement No
🏆 Feature No
📝 Refactor No
❌ Removed No
📖 Documentation No
⚠️ Break Change No

Description

Fixes #550: kool start fails with Post "http://127.0.0.1:2019/...": EOF when it adds a new port to kool-proxy (#550).

Each Caddy configuration change replaces its admin server, and the old server can close a connection before it reads the next request. kool start then failed, usually on the POST to automatic_https right after creating a listener. Kool now sends an Admin API request once more, after 100 ms, when the connection closes without an answer.


Notes

  • The new test fails on main with the reported EOF and passes with the change. go test -race ./... passes.
  • In Docker-in-Docker, starting from no kool-proxy: main failed 14 of 60 starts, this branch 0 of 80.
  • waitForCaddy probes are repeated too, so the longest wait for a new proxy grows from about 3 s to 6 s.
  • Repeating the TLS policy POST would add a duplicate policy if Caddy had applied the first one. Caddy closes these connections before reading the request, so it has not.

Each Caddy configuration change replaces its admin server, and the old
server can close a connection before it reads the next request. kool
start then failed with EOF, usually on the POST to automatic_https right
after it created a listener for a new port.

Send an Admin API request once more, after 100 ms, when the connection
closes without an answer.

Fixes kool-dev#550

[claude|agent|opus-5.5|xhigh]
@Shkeats
Shkeats force-pushed the fix/caddy-admin-retry branch from 3d0ec8c to 4cdc88e Compare November 19, 2026 16:40
@Shkeats
Shkeats marked this pull request as ready for review November 19, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-drafter:fixed Release drafter: Fixed release-drafter:patch Release drafter: Patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kool start fails with Post "http://127.0.0.1:2019/...": EOF when it adds a new port to kool-proxy

1 participant