[Tarantool-patches] [PATCH] Work-around WSL assert when SO_LINGER is set on unix sockets

Cyrill Gorcunov gorcunov at gmail.com
Wed Mar 11 13:53:15 MSK 2020


On Wed, Mar 11, 2020 at 01:43:16PM +0300, Timur Safin wrote:
>  
> : > -	/* Send all buffered messages on socket before take
> : > -	 * control out from close(2) or shutdown(2). */
> : > -	struct linger linger = { 0, 0 };
> : > +	if (family != AF_UNIX) {
> : 
> : 6. Is there any proof that it is no-op on Linux for AF_UNIX?

Yes. The SO_LINGER setup interal SOCK_LINGER socket flag which
is used in inet streamed sockets (and a few other places).
For unix sockets it is not used.

Still this approach is somehow fragile. As to me such specifics
should either handled by #ifdef which would recognize WSL or
we need some bootstrap runtime testing (which will simply be
more confusing).

IOW, I propose to detect WSL on cmake level and #ifdef the things
which are not supported.


More information about the Tarantool-patches mailing list