fix(BA-4392): Share single Docker client across container stats collection#9469
Merged
HyeockJinKim merged 6 commits intomainfrom Mar 4, 2026
Merged
fix(BA-4392): Share single Docker client across container stats collection#9469HyeockJinKim merged 6 commits intomainfrom
HyeockJinKim merged 6 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors Docker-based container stats collection to reuse a single aiodocker.Docker() client per collection pass, reducing file descriptor pressure in large deployments.
Changes:
- Update
CPUPlugin.gather_container_measures()to reuse one Docker client for all per-container API stats calls. - Update
MemoryPlugin.gather_container_measures()to reuse one Docker client for both API and sysfs-derived stats paths. - Add unit tests asserting only a single Docker client is created per collection pass, plus a changelog entry.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/ai/backend/agent/docker/intrinsic.py |
Refactors CPU/memory container stats to share a single Docker client instance during per-pass collection. |
tests/unit/agent/test_docker_intrinsic.py |
Adds tests verifying Docker client instantiation count in CPU/Memory plugins across stat modes. |
changes/9469.enhance.md |
Documents the FD-exhaustion mitigation by sharing a Docker client during stats collection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fregataa
reviewed
Feb 27, 2026
Member
fregataa
left a comment
There was a problem hiding this comment.
It would be nice to write summary description.
Do we have Docker daemon infra for unit test? @HyeockJinKim
The PR addresses a file descriptor exhaustion bug, not an enhancement. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
lablup-octodog
pushed a commit
that referenced
this pull request
Mar 4, 2026
…ction (#9469) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Backported-from: main (26.2) Backported-to: 26.2 Backport-of: 9469
|
Backport to 25.15 is failed. Please backport manually. |
HyeockJinKim
pushed a commit
that referenced
this pull request
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolves #8809 (BA-4392)
Checklist: (if applicable)
ai.backend.testdocsdirectory