-
Notifications
You must be signed in to change notification settings - Fork 6
Ignore EINTR signal for select systemcall. #22
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
Conversation
switchlink/switchlink_main.c
Outdated
|
|
||
| ret = select(num_fds, &read_fds, NULL, NULL, NULL); | ||
| if (ret == -1) { | ||
| // Select system call being interrupted by a signal EINTR. |
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.
Good comment. You explain why you are making this test.
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.
During automation we saw this issue, where intermittently switchlink_main thread is exited and none of the netlink messages are processed by infrap4d.
Upon debug observed that 'Select' system call is being interrupted by EINTR, this causes thread to exit.
While reading about this issue, figure out this can happen to any Blocking call. In our case we dont have any timeout for Select system call. Hence the chances of getting this interrupt is high.
de71472 to
2576f0a
Compare
Here select is a blocking call since no timeout is specified, so we have chances of interrupting via EINTR. When EINTR is recived, switchlink_main thread is exiting. This causes infrap4d to not process any netlink events and lnp.p4 usecases will fail. With the fix, we are ignoring EINTR error for Select systemcall Signed-off-by: Sandeep N <sandeep.nagapattinam@intel.com>
ffoulkes
left a comment
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.
Okay once the indicated change is made
2576f0a to
37d3569
Compare
ffoulkes
left a comment
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.
LGTM
Here select is a blocking call since no timeout is specified, so we have chances of interrupting via EINTR.
When EINTR is recived, switchlink_main thread is exiting. This causes infrap4d to not process any netlink events and lnp.p4 usecases will fail.
With the fix, we are ignoring EINTR error for Select systemcall
Signed-off-by: Sandeep N sandeep.nagapattinam@intel.com