Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko <alexander.turenko@tarantool.org>
To: Leonid Vasiliev <lvasiliev@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] socket: fix error while closing socket.tcp_server
Date: Wed, 6 May 2020 18:38:04 +0300	[thread overview]
Message-ID: <20200506153804.5szcwvvl22eeeilr@tkn_work_nb> (raw)
In-Reply-To: <d6933382eeb3c931d60fd5462b7dca17cf2b3767.1587731005.git.lvasiliev@tarantool.org>

> @@ -1082,6 +1085,9 @@ local function tcp_server_loop(server, s, addr)
>      fiber.name(format("%s/%s:%s", server.name, addr.host, addr.port), {truncate = true})
>      log.info("started")
>      while socket_readable(s) do
> +        if s._server_socket_closed then
> +            break
> +        end

Can we use the same check `<s>._gc_socket.fd >= 0` as in check_socket()
(we can wrap it to a function like socket_is_closed())?

It seems that using the same way for determining whether a socket is
closed owuld simplify the code a bit.

WBR, Alexander Turenko.

  parent reply	other threads:[~2020-05-06 15:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24 12:26 Leonid Vasiliev
2020-04-24 14:03 ` lvasiliev
2020-04-29 12:12 ` Ilya Kosarev
2020-05-06  8:01   ` lvasiliev
2020-05-06  8:20     ` Ilya Kosarev
2020-05-06 15:38 ` Alexander Turenko [this message]
2020-05-07  7:29   ` lvasiliev
2020-05-13 14:21     ` Alexander Turenko
2020-05-19 19:52       ` lvasiliev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200506153804.5szcwvvl22eeeilr@tkn_work_nb \
    --to=alexander.turenko@tarantool.org \
    --cc=lvasiliev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] socket: fix error while closing socket.tcp_server' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox