Skip to content

Conversation

@krissetto
Copy link
Contributor

@krissetto krissetto commented Dec 3, 2025

Make sure cagent api fails fast if the desired unix socket is in use by another process

image

Closes #1014

@krissetto krissetto requested a review from a team as a code owner December 3, 2025 11:17
// Check if socket file exists
if _, err := os.Stat(path); err == nil {
// Socket file exists - check if another process is using it
conn, err := net.DialTimeout("unix", path, 100*time.Millisecond)
Copy link
Member

Choose a reason for hiding this comment

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

We should only check for the socket existence, not try and connect to it. This means we also need to make sure we cleanup the socket when cagent api exits

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fair, adjusting now

@krissetto
Copy link
Contributor Author

@rumpl feel free to undraft or close this once you know what you want to achieve here

@krissetto krissetto marked this pull request as draft December 3, 2025 15:10
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.

Only one server

2 participants