-
Notifications
You must be signed in to change notification settings - Fork 463
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
Busy loop when poll/epoll is in use #4605
Comments
CUPS.org User: twaugh.redhat Actually this happens with plain poll() as well, at least on Linux: poll([{fd=3, events=POLLIN}, {fd=10, events=POLLIN}, {fd=11, events=POLLIN}, {fd=12, events=POLLIN}, {fd=15, events=0}, {fd=16, events=0}], 6, 1000) = 2 ([{fd=15, revents=POLLHUP}, {fd=16, revents=POLLHUP}]) |
CUPS.org User: twaugh.redhat Here's the fix I'm using. Rather than removing the callbacks, leave them in place and deal with the consequences. This is sort of what was already happening before the call to cupsdAddSelect(..., NULL, NULL, ...) was added. |
CUPS.org User: mike Fixed in Subversion repository. |
"cups-busy-loop.patch": diff -up cups-2.0.2/scheduler/client.c.busy-loop cups-2.0.2/scheduler/client.c
cupsdLogClient(con, CUPSD_LOG_DEBUG, "Closing on unexpected HTTP read state %s.", if (httpGetState(con->http) == HTTP_STATE_POST_SEND)
- */- cupsdAddSelect(httpGetFd(con->http), NULL, NULL, con);
|
CUPS.org User: till.kamppeter Probably this Ubuntu bug report treats the same bug: |
Version: 2.0-current
CUPS.org User: twaugh.redhat
epoll_wait() will always wait for EPOLL_HUP even if event.events==0. This causes a busy loop when a connection is closed just after this moment, in scheduler/client.c:1980:
/*
* Don't listen for activity until we decide to do something with this...
*/
cupsdAddSelect(httpGetFd(con->http), NULL, NULL, con);
This causes an event with event.events==0 to be added/modified with epoll_ctl().
Original report:
https://bugzilla.redhat.com/show_bug.cgi?id=1179596
The text was updated successfully, but these errors were encountered: