[Tile-serving] [openstreetmap/mod_tile] Replace select() by poll(). (#239)
Tom Hughes
notifications at github.com
Mon Jun 21 11:22:50 UTC 2021
I don't think I have a saved strace but it gets stuck in a loop calling `select` and getting an error (`EBADF` I think) back.
Fundamentally bad things are going to happen as soon as a connection has an FD over 1023 though as the code just goes ahead and tries to add that to the select set, which writes beyond the end of the set so trashes some random bit of memory.
Then it calls select with a limit over 1023 but the extra bits probably get lost in libc or something and the kernel winds up erroring.
I'll try and get a trace if it happens again but `select` is fundamentally bad both because of the fixed set size (unless you carefully redefine `FD_SETSIZE` to increase it at compile time) and `poll` generally scales much better. See http://0pointer.net/blog/file-descriptor-limits.html for some recent advice on this area...
Obviously I can reduce NOFILE to 1024 on our servers but that will just cause different issues if we're reaching the point that we need that many descriptors.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/mod_tile/pull/239#issuecomment-864954986
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20210621/0df3d798/attachment.htm>
More information about the Tile-serving
mailing list