* > /dev/null

Home | Tags | Archives

Technical Debt

Entries feed - Comments feed

Technical dept, part II: SO_REUSEPORT - more than meets the eye?

This actually might become a recurring thing for me, since I have the time and inclination, I've decided to give this idea the tentative term technical dept, so without further ado, here's part II:

Prompted by a a conversation on Twitter I happened upon, I went digging for the original purpose the SO_REUSEPORT, as despite the fact that it's being used very effectively by NGINX, it's not something that seems to have been a worry not that long ago. Turning to my, at this point, trusty old friend source revisioning, to my surprise I found that the feature is much, much older than I expected. It dates back at least to July, 1992 when Andrew Cherenson at SGI used it to fix a bug for multicast, not long after TCP/IP was added and reworked in BSD4.1 and BSD4.2 respectively.

Which also brings up another rather salient point - it's very important to document why a change was made. Andrew seems to have intended this feature solely for a bugfix, but now look at all the interesting ways it's being used.

It is also a bit curious to me that it's a feature that was only added to Linux in 2013 - making it more than 20 years in the making.

jmg@ helpfully pointed me towards an in-depth technical coverage of what it, and the related SO_REUSEADDR, does - and I think it merits reading.

Technical dept, part I: On the origin of die_you_gravy_sucking_pig_dog()

‚ÄčA little while ago brnrd@ on Twitter brought up the function, mentioned in the title of this post, which has been part of the BSD source tree in /usr/src/sbin/shutdown/shutdown.c for quite a while, and since I've always been fond of Steve Martins comedy routines and also like looking through source code that's older than most peoples experience with computers, I decided I'd go look for its origins.

After a bit of digging around, I decided to send Keith Bostic an email asking whether he lay claim to it.

On Thu, Oct 26, 2017 at 22:23, Keith Bostic wrote:

Wow, that's from a long time ago. :)

Yeah, that was probably me.

I was always a big Steve Martin fan.

--keith

So here it is, saved for posterity.

Make of it what you will, but I think it's fascinating that code that old still lives to this day.