UNIX-SIMPLE-POLL restarts timeouts for EINTR

Bug #2078824 reported by Michał "phoe" Herda
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
New
Undecided
Unassigned

Bug Description

The current sb-unix:unix-simple-poll implementation is buggy wrt. EINTR handling; the timeout is reset on every EINTR, meaning that on a busy system, where EINTR happens regularly, longer timeouts will never trigger.

This is what was causing Keepit queues on production (and to some extent on test) to fail to time out, whereas on dev and build systems this worked great.

The bug has been reported to the sbcl-help mailing list at https://sourceforge.net/p/sbcl/mailman/message/35854538/ but AFAIK this was never followed up on. I just discovered that Keepit, for years, has been using a never-upstreamed fix that meddles with SBCL internals, so I'm tying the loose threads in hope of removing the hack from our codebase.

Revision history for this message
Michał "phoe" Herda (phoe-krk) wrote :
Revision history for this message
Christophe Rhodes (csr21-cantab) wrote :

The patch looks OK to me but it would be nice to fix the #-os-provides-poll case further down, I think? It looks like it has the same issue.

Revision history for this message
Michał "phoe" Herda (phoe-krk) wrote :

OK. I edited and loaded the modified UNIX-SIMPLE-POLL and my SBCL still seems to work, and the timeout logic seems OK. It's the first time in my career when I touch syscalls though, so please review before merging.

Revision history for this message
Wojciech S. Gac (wsgac) wrote :

In the first hunk you have `(let ((timeout (if (= minusp to-msec)' instead of the intended `(let ((timeout (if (minusp to-msec)'.

Revision history for this message
Michał "phoe" Herda (phoe-krk) wrote :

Thanks.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.