prometheus: remove stale unix socket file when binding from ffi - #48432
Merged
Merged
Conversation
jkarneges
force-pushed
the
jkarneges/prom-rm-before-bind
branch
from
September 14, 2026 16:54
f69a6b6 to
6459971
Compare
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
Refactors the Prometheus FFI server creation to reuse existing NetListener::bind_config logic so stale Unix socket files are removed before binding.
Changes:
- Replace custom FFI listen-address parsing with
NetListenConfig+NetListener::bind_config. - Add
NetListenConfig::from_prometheus_port_strhelper for parsing the Prometheus listen format (ipc://…,host:port, orport).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/core/prometheus.rs | Refactors FFI server creation to parse into NetListenConfig and bind via bind_config (stale unix socket cleanup). |
| src/core/config.rs | Adds a parsing helper to build NetListenConfig from the Prometheus port/address string format. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
jkarneges
force-pushed
the
jkarneges/prom-rm-before-bind
branch
from
September 14, 2026 18:49
6459971 to
a8731f5
Compare
clintjedwards
approved these changes
Sep 14, 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.
When binding a unix socket, the specified file must not exist. We already have logic to handle this in
NetListener::bind_config(i.e. delete stale file before binding), we just need to be using it. This PR refactors theprometheus_server_createFFI function to callbind_config.