From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: Date: Mon, 25 Feb 2019 19:50:47 +0300 From: Konstantin Osipov Subject: Re: [tarantool-patches] [PATCH v2] iproto: close socket explicitly before wal_dir at exit Message-ID: <20190225165047.GF2663@chai> References: <20190225145625.10840-1-i.kosarev@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190225145625.10840-1-i.kosarev@tarantool.org> To: tarantool-patches@freelists.org Cc: vdavydov.dev@gmail.com, i.kosarev@corp.mail.ru, Ilya Kosarev List-ID: * Ilya Kosarev [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