[tarantool-patches] [PATCH v2] iproto: close socket explicitly before wal_dir at exit

Konstantin Osipov kostja.osipov at gmail.com
Mon Feb 25 19:50:47 MSK 2019


* Ilya Kosarev <i.kosarev at tarantool.org> [19/02/25 19:14]:
> +void
> +iproto_free()
> +{
> +	tt_pthread_cancel(net_cord.id);
> +	tt_pthread_join(net_cord.id, NULL);
> +	/*
> +	* Close socket descriptor to prevent hot standby instance
> +	* failing to bind in case it tries to bind
> +	* before socket is closed by OS.
> +	*/
> +	close(binary.ev.fd);
> +}

What if there is no socket descriptor in binary.ev.fd?
I understand it's OK to close a non-existing descriptor, but still
looks a bit messy to me.

-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov



More information about the Tarantool-patches mailing list