Tarantool development patches archive
 help / color / mirror / Atom feed
From: Leonid Vasiliev via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: sergeyb@tarantool.org, tarantool-patches@dev.tarantool.org
Cc: alexander.turenko@tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v1 3/4] test: enable SO_REUSEADDR on socket in httpd.py
Date: Thu, 14 Jan 2021 12:09:34 +0300	[thread overview]
Message-ID: <65291d86-7476-06a6-49ad-99bb15cbd3f1@tarantool.org> (raw)
In-Reply-To: <21efa7345344e8ecbe09d2b55e33f876d30b65cd.1610526975.git.estetus@gmail.com>

Hi! Thank you for the patch.
LGTM.

This is a popular technique.
But I don't understand:"Why is it needed when python3 is used, but not 
needed for python2?" If you know, share with me, if not, let it remain a
mystery.

On 13.01.2021 11:48, sergeyb@tarantool.org wrote:
> From: Sergey Bronnikov <sergeyb@tarantool.org>
> 
> TL;DR httpd.py warns that port is busy when restart server. With socket
> option SO_REUSEADDR it allows to restart httpd.py without problem.
> 
> Socket option SO_REUSEADDR tells the kernel that even if this port is
> busy, go ahead and reuse it anyway. If it is busy, but with another
> state, you will still get an address already in use error. It is useful
> if your server has been shut down, and then restarted right away while
> sockets are still active on its port.
> ---
>   test/app-tap/httpd.py | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/test/app-tap/httpd.py b/test/app-tap/httpd.py
> index 62435e91a..60084bdbf 100755
> --- a/test/app-tap/httpd.py
> +++ b/test/app-tap/httpd.py
> @@ -138,6 +138,7 @@ else:
>       usage()
>   
>   sock = socket.socket(sock_family, socket.SOCK_STREAM)
> +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
>   sock.bind(sock_addr)
>   sock.listen(10)
>   
> 

  parent reply	other threads:[~2021-01-14  9:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13  8:48 [Tarantool-patches] [PATCH v1 0/4] Support Python 3 in Tarantool tests Sergey Bronnikov via Tarantool-patches
2021-01-13  8:48 ` [Tarantool-patches] [PATCH v1 1/4] test: fix app-tap/http_client.test.lua Sergey Bronnikov via Tarantool-patches
2021-01-14  8:47   ` Leonid Vasiliev via Tarantool-patches
2021-01-14  9:50     ` Sergey Bronnikov via Tarantool-patches
2021-01-14 12:23   ` Alexander Turenko via Tarantool-patches
2021-01-14 12:52     ` Sergey Bronnikov via Tarantool-patches
2021-01-14 12:57       ` Alexander Turenko via Tarantool-patches
2021-01-13  8:48 ` [Tarantool-patches] [PATCH v1 2/4] test: fix xlog-py/big_lsn.test.py Sergey Bronnikov via Tarantool-patches
2021-01-14  9:02   ` Leonid Vasiliev via Tarantool-patches
2021-01-14  9:51     ` Sergey Bronnikov via Tarantool-patches
2021-01-14 12:38   ` Alexander Turenko via Tarantool-patches
2021-01-14 12:52     ` Sergey Bronnikov via Tarantool-patches
2021-01-13  8:48 ` [Tarantool-patches] [PATCH v1 3/4] test: enable SO_REUSEADDR on socket in httpd.py Sergey Bronnikov via Tarantool-patches
2021-01-13 19:59   ` Cyrill Gorcunov via Tarantool-patches
2021-01-14  9:09   ` Leonid Vasiliev via Tarantool-patches [this message]
2021-01-14  9:57     ` Sergey Bronnikov via Tarantool-patches
2021-01-14 12:51       ` Alexander Turenko via Tarantool-patches
2021-01-13  8:48 ` [Tarantool-patches] [PATCH v1 4/4] test: enable disabled testcases back Sergey Bronnikov via Tarantool-patches
2021-01-14  9:10   ` Leonid Vasiliev via Tarantool-patches
2021-01-13 20:03 ` [Tarantool-patches] [PATCH v1 0/4] Support Python 3 in Tarantool tests Cyrill Gorcunov via Tarantool-patches
2021-01-14 11:10 ` Leonid Vasiliev via Tarantool-patches
2021-01-15  9:34 ` Kirill Yukhin via Tarantool-patches

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=65291d86-7476-06a6-49ad-99bb15cbd3f1@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=lvasiliev@tarantool.org \
    --cc=sergeyb@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v1 3/4] test: enable SO_REUSEADDR on socket in httpd.py' \
    /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