Skip to content
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

fix: unlink cache unix socket #1435

Merged
merged 5 commits into from
May 13, 2024
Merged

fix: unlink cache unix socket #1435

merged 5 commits into from
May 13, 2024

Conversation

amitza
Copy link
Contributor

@amitza amitza commented May 12, 2024

Description

When deploying the cache service on a machine that already had one running the error: bind failed. Error: Address already in use. Unlike TCP the sock file must be cleaned out of the filesystem after service exit.

Using syscall.unlink before creating the new unix socket makes sure that the filesystem is clean when creating a new one.
This also makes sure that no matter how the program existed the socket will always be deleted.

Also using SplitHostPort and ResolveUnixAddr to properly parse and initiate the unix socket.

How this was tested?

Aside from running locally, this was tested by coping the PR artifact to testing server, restarting the cache, then restarting it again and making sure IPRPC can reach it.

Author Checklist

  • This feature was tested
  • Lint and tests passed locally
  • This feature was documented

@amitza amitza self-assigned this May 12, 2024
Copy link

github-actions bot commented May 12, 2024

Test Results

1 949 tests  ±0   1 949 ✅ ±0   29m 40s ⏱️ -19s
  135 suites ±0       0 💤 ±0 
   19 files   ±0       0 ❌ ±0 

Results for commit 8d28279. ± Comparison against base commit 367d167.

♻️ This comment has been updated with latest results.

@amitza amitza changed the title Fix: unlink cache unix socket fix: unlink cache unix socket May 12, 2024
@amitza amitza requested review from nimrod-teich and ranlavanet May 12, 2024 22:38
@ranlavanet ranlavanet merged commit 9fb3f9b into main May 13, 2024
30 checks passed
@ranlavanet ranlavanet deleted the fix/cache-unix-socket branch May 13, 2024 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants