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

main: improve api socket bind #118

Merged
merged 1 commit into from
Jan 8, 2025
Merged

main: improve api socket bind #118

merged 1 commit into from
Jan 8, 2025

Conversation

ogournet
Copy link
Contributor

@ogournet ogournet commented Jan 8, 2025

If the grout process is launched a second time, then socket api bind() failed and the process unlink socket file before exiting, making the first running process unreachable.

If the grout process crash, it won't remove api socket file, and the next invocation will fail at socket api bind().

Change api_socket_start() to check, if bind() fails, whether there's a listening process behind the scene:

  • If there is, exit without removing socket api file
  • If there is not, then remove file and resume bind.

Copy link
Collaborator

@rjarry rjarry left a comment

Choose a reason for hiding this comment

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

Hi Olivier, this looks good. I just have some minor remarks.

main/main.c Outdated Show resolved Hide resolved
main/main.c Outdated Show resolved Hide resolved
main/api.c Outdated Show resolved Hide resolved
@rjarry rjarry force-pushed the main branch 4 times, most recently from 5c890dd to d9c6ad3 Compare January 8, 2025 16:55
If the grout process is launched a second time, then socket api bind() failed
and the process unlink socket file before exiting, making the first running
process unreachable.

If the grout process crash, it won't remove api socket file, and the next
invocation will fail at socket api bind().

Change api_socket_start() to check, if bind() fails, whether there's a
listening process behind the scene:

* If there is, exit without removing socket api file
* If there is not, then remove file and resume bind.

Signed-off-by: Olivier Gournet <[email protected]>
Copy link
Collaborator

@rjarry rjarry left a comment

Choose a reason for hiding this comment

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

thanks 👍

@rjarry rjarry merged commit ea21ecc into DPDK:main Jan 8, 2025
6 checks passed
@ogournet ogournet deleted the api-socket branch January 9, 2025 08:01
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.

2 participants