Skip to content

Fix Docker client cache isolation by endpoint - #25

Open
meanmail wants to merge 1 commit into
StepicOrg:masterfrom
meanmail:fix/docker-client-cache-endpoint
Open

meanmail wants to merge 1 commit into
StepicOrg:masterfrom
meanmail:fix/docker-client-cache-endpoint

Conversation

@meanmail

@meanmail meanmail commented Oct 4, 2026 •

Copy link
Copy Markdown

The Docker client cache currently ignores the daemon URL, so requests to another endpoint (including after configure(docker_url=...)) can reuse a client connected to the first daemon. Include the resolved base URL in the cache key while retaining the existing retry-policy separation.

Add five regression tests covering endpoint isolation, endpoint reconfiguration, client reuse, and retry-policy isolation. The two endpoint-isolation tests fail before the fix; all five pass afterward.

Validation:

  • Verified against two independent Docker daemons: Docker 29.5.2 over a Unix socket and Docker 27.5.1 over localhost TCP. The original code reused the first daemon for both URLs. With the fix, containers were created only on the selected daemon, and stdin/stdout round-tripped successfully on each. This check used real Docker clients and containers.
  • Ran the full suite with Python 3.9.25, Docker SDK 7.2.0, and pytest 7.4.4 in an isolated Colima VM, using the official stepic/epicbox-python image through amd64 emulation: 41 passed, 2 failed. Unchanged master in the same environment: 36 passed, 2 failed.
  • Both versions fail test_fork_exceed_processes_limit (realtime timeout) and test_without_processes_limit (OOM under the 64 MiB limit). There are no additional failures compared with master; the full suite is not green in this environment.

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.

1 participant