-
-
Notifications
You must be signed in to change notification settings - Fork 631
Support pkimetal via Unix socket #8531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add Socket field to PKIMetalConfig struct - Modify execute() to create HTTP client with Unix socket transport - Update docker-compose.yml to use pkimetal v1.32.0 with Unix socket - Configure socket volume sharing between boulder and pkimetal - Update test configs to use Unix socket instead of HTTP endpoint Co-authored-by: mcpherrinm <47425+mcpherrinm@users.noreply.github.com>
- Add timeout to HTTP client for Unix socket transport - Use url.JoinPath for Unix socket URL construction for consistency Co-authored-by: mcpherrinm <47425+mcpherrinm@users.noreply.github.com>
- Create pkimetal.yaml config files with server.webserverPath setting - Mount config file in docker-compose instead of using command-line args - Add config for both test/config and test/config-next directories Co-authored-by: mcpherrinm <47425+mcpherrinm@users.noreply.github.com>
- Ensure both Unix socket and HTTP connections respect configured timeout - Improve comment clarity about localhost usage in Unix socket URLs Co-authored-by: mcpherrinm <47425+mcpherrinm@users.noreply.github.com>
|
@Copilot, this PR appears to contain configuration and/or SQL schema changes. Please ensure that a corresponding deployment ticket has been filed with the new values. |
| // Use Unix socket connection | ||
| client = &http.Client{ | ||
| Timeout: timeout, | ||
| Transport: &http.Transport{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To enable connection reuse, we shouldn't create a new http.Client (and importantly, http.Transport) for each request.
This code is a bit more verbose than it needs to be: Only the dummy value in place of pkim.Addr and Transport needs to change if pkim.Socket is set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored to store the HTTP client in the struct for reuse across requests, enabling connection pooling. The code now only conditionally sets the Transport and base URL, eliminating duplication. Changes in commit 86c1eb9.
- Store http.Client in PKIMetalConfig struct for reuse across requests - Initialize client lazily on first execute() call - Only conditionally set Transport for Unix socket, simplifying code - Reduces verbosity by eliminating duplicate client creation logic Co-authored-by: mcpherrinm <47425+mcpherrinm@users.noreply.github.com>
- Use sync.Once to ensure thread-safe HTTP client initialization - Remove timeout from client (apply per-request via context instead) - Prevents race conditions when multiple goroutines call execute() Co-authored-by: mcpherrinm <47425+mcpherrinm@users.noreply.github.com>
Implementation Plan for pkimetal Unix Socket Support
Socketfield toPKIMetalConfigstruct inlint_cert_via_pkimetal.goexecute()method to create HTTP client with Unix socket transport whenSocketis configuredtest/config/zlint.tomlto use socket configurationtest/config-next/zlint.tomlto use socket configurationSummary
All changes completed. The implementation enables pkimetal to run via Unix socket with thread-safe connection pooling.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.