News for hackers. Stuff that matters.
Re:Linux 3.9 introduced a new way of writing socket servers by haberman on Saturday August 24, 2013 @03:07PM (#6269469)
Interesting. It seems like one potential hazard is that bonafide port conflicts are not detected. If SO_REUSEPORT is preferred for performance reasons, and most/all servers are using it, then starting up a server that uses the same port as an existing service becomes a silent error.

It could even work as expected for a while (since the kernel gets to arbitrarily decide what port to deliver incoming requests to) only to intermittently fail later.

Re:Linux 3.9 introduced a new way of writing socket servers by geocar on Saturday August 24, 2013 @03:24PM (#6269527)
I can't imagine people will start using SO_REUSEPORT by default, since the "performance reasons" are a happy accident of having a hint (that the process wants wakeups distributed across all CPUs). I'd rather get that hint in another way- perhaps by sharing an epollfd with multiple processes.

I would however like SO_REUSEPORT to run experiments: Right now we use iptables/tc to direct some traffic at "new versions" of some of our systems so we can run tests with live data, but connection tracking for localhost is lame. I'd much rather use SO_REUSEPORT.

Re:Linux 3.9 introduced a new way of writing socket servers by ikeepforgetting on Saturday August 24, 2013 @05:11PM (#6269801)
Listening to the same port requires processes with the same uid.
Re:Linux 3.9 introduced a new way of writing socket servers by rbanffy on Sunday August 25, 2013 @10:13AM (#6272046)
> then starting up a server that uses the same port as an existing service becomes a silent error.

Only if it has the same uid as the other one. It'd also be trivial to check whether the other processes listening to your port are "friendly" (as in "you don't want both Apache and Nginx listening on port 80").

Re:Linux 3.9 introduced a new way of writing socket servers by cbr on Sunday August 25, 2013 @11:40AM (#6272384)
Having Apache and Nginx both listening on port 80 might be an interesting way to A/B test them.
Re:Linux 3.9 introduced a new way of writing socket servers by MertsA on Saturday August 24, 2013 @04:25PM (#6269687)
The second process would have to be run under the same user for that to happen though so a real production system would probably never be impacted by this but what would be nice is a flag to restrict the port to children of a particular PID or just lock it to one particular PPID.
Re:Linux 3.9 introduced a new way of writing socket servers by wicknicks on Saturday August 24, 2013 @03:32PM (#6269544)
I imagine production servers would run monitoring processes to remove such "listening bugs".