-
Notifications
You must be signed in to change notification settings - Fork 6
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
server-client ping-pong: Server should timeout #21
Comments
Note that in the |
Thank you. I will look at that URL, learn some cats, and try in my experimental program. Of course, now I have gone and hacked around what was causing the hang. This Issue will serve as a reminder that I need to create a PR after I understand & get it working. Rapid turn around progress. |
I spent time tracing this one out. I feel like a hobo trying to catch a fast train, but I I have the timeout code executing several places without either harm or benefit, More next sprint (or the one thereafter). |
Thank you for posting the reproducer in #29 (comment). The problem is that |
Presenting problem
For simplicity, I will phrase this in terms of the TcpSuite
server-client ping-pong
test,but the problem is general to at least that Suite. I will also talk about
accept()
butthe fix is probably has to do with the socket_fd used for
listen()
.The issue is that sometimes one wants a server to sit and accept() connections for
the lifetime of the program. Other times, often if a human is waiting at the other
end, one wants to wait only a specified period and then timeout, perhaps to
do something about the lack of connection.
Currently, when there is some failure on the client path,
ping-pong
server hangs until it isinterrupted by user action (^C). Not good for an automated test.
If it is a culturally appropriate idiom, the server
accept()
ought to timeout.Discussion
The crude hammer of
alarm()
can be mentioned and skipped over.Linux has a concept of
timerfd
s. I have not done it, but fromreading, these can be registered with epoll and used as one
of the events it monitors.
The may be some complexity. Somebody may need to
epoll
on the listen_fd and the timer_fd. If the listen_fdreports an suitable event, the C accept() is called.
I have not traced the epoll.scala accept call to look
at implementation. I first need to understand
the cultural milieu.
The text was updated successfully, but these errors were encountered: