Hi Willy,
On 08/03/2024 17:05, Willy Tarreau wrote:
We could just have "abns2" and declare that it's the second version of the
abns format and know that this one is interoperable with a number of other
components.
Having abns@ and abns2@ strictly for that one difference seems like a
lot to me, to be honest, but I get the argument that they are otherwise
fundamentally incompatible... Hmm...
It would even be easier to deal with for those who document
such components because their integration docs would just indicate that
the address has to be placed after "abns2@" in haproxy, instead of saying
"and don't forget to adjust this global setting in your config, unless you
already use abns anywhere else".
Considering there's barely any documentation on the internet as a whole
about abstract unix sockets, I doubt we should worry too much about that
bit.
Also the target audience for those is unlikely to be too deterred.
Indeed, right now it seems that your patch
does nothing for the receivers, bind() still uses sizeof(), and the
sock_unix_addrcmp() function continues to compare the full name, making
such sockets non-transferable across reloads. So it's unclear to me how
this can work in your test :-/
Maybe I'm missing some place/case, but at least for trivial binds it
certainly works; which explains why the test passes :-)
// without tightsocklen
$ netstat -l | grep @haproxy
unix 2 [ ACC ] STREAM LISTENING 934838
@haproxy-f1@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
// with tightsocklen
$ netstat -l | grep @haproxy
unix 2 [ ACC ] STREAM LISTENING 956878 @haproxy-f1
Thus I think it would be preferable to go that route rather than having
to deal with all exceptions everywhere based on a global-only option.
We can help on this, of course.
Well I do want it so I'm fine with doing it. But I wonder if it's not a
bit of a:
- abns@ eventually not used by anyone as everything keeps on moving away
from padding
- abns2@ eventually the default, which is quite jarring I suppose
If it's easier that way, I'd prefer making it a proper bind/server
option, which allows for easier transition, and can just change default
value down the line if necessary?
Thanks,
Tristan