Skip to content

Refactor to reuse Podman client for HTTP requests in runtime#523

Merged
youngtaekiim merged 1 commit into
mainfrom
feature/reuse-podman-client
Jul 9, 2026
Merged

Refactor to reuse Podman client for HTTP requests in runtime#523
youngtaekiim merged 1 commit into
mainfrom
feature/reuse-podman-client

Conversation

@youngtaekiim

Copy link
Copy Markdown
Contributor

This pull request refactors the HTTP client usage in the Podman runtime module to improve efficiency and code clarity. The main change is that the code now uses a single, shared hyper::Client instance for all requests, instead of creating a new client on each call. This reduces resource usage and improves performance.

Podman HTTP client refactor:

  • Introduced a static PODMAN_CLIENT using once_cell::sync::Lazy, so the hyper::Client is created only once and reused for all get, post, and delete requests.
  • Centralized the Podman socket path in a single constant PODMAN_SOCKET, removing repeated code and making it easier to update the socket path if needed.
  • Simplified the get, post, and delete functions to use the shared client and socket constant, reducing duplication and potential for errors.

@Chulhee1Lee Chulhee1Lee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the Podman runtime HTTP helper layer in nodeagent to reuse a single hyper::Client instance across requests, reducing per-call client construction overhead and centralizing the Podman socket path.

Changes:

  • Introduced a shared, lazily-initialized PODMAN_CLIENT (once_cell::sync::Lazy) for all Podman HTTP requests.
  • Centralized the Podman Unix socket path into a single PODMAN_SOCKET constant.
  • Updated get/post/delete helpers to use the shared client and socket constant.

Comment thread src/agent/nodeagent/src/runtime/podman/mod.rs
Comment thread src/agent/nodeagent/src/runtime/podman/mod.rs
@youngtaekiim
youngtaekiim merged commit a831c66 into main Jul 9, 2026
2 checks passed
@youngtaekiim
youngtaekiim deleted the feature/reuse-podman-client branch July 10, 2026 02:12
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.

[PERFORMANCE] reuse Podman HTTP client instead of creating a new client for every request

3 participants