[squid-dev] ftruncate() failures on OS X (Darwin)
Markus Mayer
code at mmayer.net
Fri Jan 22 03:03:30 UTC 2016
Alright. Here is the patch as git patch. Hope that works.
I left out the "flags" variable from the shm_open() call that you showed,
since I didn't see it being used or declared anywhere.
The commit message is lengthy, but I tried to explain what's going on, so
others don't have to go digging for the same problem in the future.
I did test it, and it works "as advertised". I noticed that the 4.0 code
base of Squid does a much better job of cleaning up after itself than 3.5
did. With 3.5, I could trigger the problem by starting Squid in the
foreground ("squid -N") and then hitting Ctrl-C twice (the second time
would interrupt the cleanup process). With the 4.0 code base, I had to use
"kill -9" to get it to leave the shared memory segments behind. My other
attempts at triggering the problem failed, because it continued to clean up
properly, despite being sent multiple signals.
The improved cleanup is good news. It means the EEXIST condition won't be
hit nearly as much as it would otherwise.
Regards,
-Markus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20160121/d69f596b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-Ipc-Mem-Segment-create-for-OS-X.patch
Type: application/octet-stream
Size: 4340 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20160121/d69f596b/attachment.obj>
More information about the squid-dev
mailing list