about summary refs log tree commit homepage
path: root/lib/PublicInbox/DSPoll.pm
DateCommit message (Collapse)
2023-11-26select+poll: have caller retry on EINTR
We can't assume signals are blocked when neither signalfd nor EVFILT_SIGNAL are in use. So just return an empty result so the caller can recalculate the timeout. I found this bug while making xt/httpd-async-stream.t use our event loop to reap processes but have abandoned that effort for now since it didn't save any code.
2023-11-01ds: move maxevents further down the stack
The epoll implementation is the only one which respects the limit (kevent would, but IO::KQueue does not). In any case, I'm not a fan of the maxevents=1000 historical default since it leads to fairness problems with shared non-blocking listeners across multiple daemon workers.
2023-10-31poll+select: check EBADF + POLLNVAL errors
I hit this in via select running -cindex with some other experimental patches. I can't reproduce the problem, though, but this ensure we have a chance to diagnose it if it happens again instead of looping on select(2) => EBADF.
2023-09-12Revert "dspoll: switch to the documented IO::Poll API"
This reverts commit 831ac641e8c23e3c87931b902527d7f5600fd80a.
2023-09-11dspoll: switch to the documented IO::Poll API
IO::Poll::_poll has always been an undocumented API. While it's remained working so far (since the early 2000s with Danga::Socket), I'm uncomfortable continuing with it moving forward since it's not documented (the leading underscore typically means it's not meant to be used by 3rd-parties). So switch to the documented API and just learn to live with some redundant object references and awkwardness in the API.
2023-09-11ds: use object-oriented API for epoll
This allows us to cut down on imports and reduce code. This also makes it easier (in the next commit) to provide an option to disable epoll/kqueue when saving an FD is valued over scalability.
2021-01-01update copyrights for 2021
Using "make update-copyrights" after setting GNULIB_PATH in my config.mak
2020-12-28ds: flatten + reuse @events, epoll_wait style fixes
Consistently returning the equivalent of pollfd.revents in a portable manner was never worth the effort for us, as we use the same ->event_step callback regardless of POLLIN/POLLOUT/POLLHUP. Being a Perl, @events knows it size and we don't have to return a maximum index for the caller to iterate on. We can also avoid redundant integer coercion ("+0") since we ensure everything is an IV in other places. Finally, vec() is preferable to ("\0" x $size) for resizing buffers because it only needs to write the extended portion and not overwrite the entire buffer.
2020-02-06treewide: run update-copyrights from gnulib for 2019
I didn't wait until September to do it, this year!
2019-06-26ds: cleanup poll test and avoid clobbering imports
On Linux systems with epoll support, we don't want to be clobbering defined subs in the t/ds-poll.t test; so use OO ->method dispatch instead and require users to explicitly import subs via EXPORT_OK.
2019-06-24ds: reimplement IO::Poll support to look like epoll
At least the subset of epoll we use. EPOLLET might be difficult to emulate if we end up using it.