Windows: Docker API ignores Connection: close, so a body-less 204 (container start) hangs Testcontainers for .NET
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- docker, rust
- Domain
- backend-api-design
Research direction
Start by tracing how Kiri handles Docker Engine API requests over named pipes and how it writes HTTP responses for container start. Check whether the server honors the request's Connection: close header after sending a body-less 204 response. Reproduce with the PowerShell request in the issue; done when the client receives EOF after the 204.
Written by the indexing model from the issue text.
Description
Kiri version and system
Kiri 0.2.0 on Windows 11 Pro 10.0.26200 (x64), Docker API over \\.\pipe\kiri (also reached through \\.\pipe\docker_engine).
What you did
Sent Docker Engine API requests with the header Connection: close over the named pipe, as Docker.DotNet does on every request (it is the client under Testcontainers for .NET 4.11). Minimal repro in PowerShell, no Docker client involved:
$p = [IO.Pipes.NamedPipeClientStream]::new('.', 'kiri', [IO.Pipes.PipeDirection]::InOut); $p.Connect(3000)
$req = "POST /containers/<id>/start HTTP/1.1`r`nHost: docker`r`nConnection: close`r`nContent-Length: 0`r`n`r`n"
$b = [Text.Encoding]::ASCII.GetBytes($req); $p.Write($b, 0, $b.Length); $p.Flush()
# read until EOF, with a 5 s timeout
(<id> from a plain POST /containers/create with {"Image":"alpine:3.20","Cmd":["sleep","30"]}.)
What happened
Kiri answers, but never closes the connection. After 5 s the pipe is still open with no EOF:
HTTP/1.1 204 No Content
Api-Version: 1.47
Docker-Experimental: false
Ostype: linux
Server: Kiri/0.2.0 (linux)
The 204 carries neither Connection: close nor Content-Length. The 201 from create also stays open after its body; clients cope there because it carries a body length, but a body-less 204 leaves them waiting for the end of the response.
Effect: Testcontainers for .NET hangs forever right after POST /containers/{id}/start returns 204 (Docker.DotNet waits for the connection to end before it completes the response). A test run sat 16 minutes with no further API call.
What you expected instead
What dockerd does: when the request says Connection: close, the server closes the connection after sending the response (RFC 9112 §9.6), so the client sees EOF right after the 204.
Anything else
- Happens every time.
- Workaround: a small named-pipe relay in front of
\\.\pipe\kirithat closes the client connection after a 204/304 response, withdocker.host=npipe://./pipe/<relay>in~/.testcontainers.properties. With that (plus rewriting"Cmd":[]tonull, which is the separate #121 / #222 problem: Ryuk fails with400 no command specified, andmcr.microsoft.com/mssql/serverruns its entrypoint with no arguments and exits), Testcontainers for .NET with Ryuk enabled and SQL Server works on Kiri. - Related: #121, #222.
- Dominant language
- Rust
- Stars
- 7.5k
- Forks
- 329
- Avg merge
- 7h 48m
- Merged PRs (30d)
- 105
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from libracoder/kiri
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
libracoder/kiri#364 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
libracoder/kiri#289 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 47/100
libracoder/kiri#365 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
libracoder/kiri#362 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 47/100
libracoder/kiri#359 ·
Maintainers usually reply within 1 day
Similar issues
-
benchmark-review
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
area:filesystem bug need-triage
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Captions panel does not offer to show an existing transcriptPossibly taken @thedavidweng claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
CapSoftware/Cap#4276 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
matrix-org/matrix-rust-sdk#7495 ·
Maintainers usually reply within 1 day