Tarantool development patches archive
 help / color / mirror / Atom feed
From: "Илья Косарев" <dmarc-noreply@freelists.org> (Redacted sender "i.kosarev" for DMARC)
To: tarantool-patches@freelists.org
Cc: "Илья Косарев" <i.kosarev@corp.mail.ru>
Subject: [tarantool-patches] [tarantool-patches] [PATCH] Close socket explicitly before wal_dir at exit
Date: Thu, 14 Feb 2019 22:31:33 +0300	[thread overview]
Message-ID: <1550172693.644367672@f105.i.mail.ru> (raw)

[-- Attachment #1: Type: text/plain, Size: 1430 bytes --]


tarantool instance didn't close socket explicitly which could cause hot standby instance to fail to bind in case it tries to bind before socket is closed by OS. Now it is fixed by closing socket explicitly before wal_dir.
Closes #3967
---
Branch: https://github.com/tarantool/tarantool/tree/i.kosarev/gh-3967-close-socket-explicitly
Issue: https://github.com/tarantool/tarantool/issues/3967
src/box/box.cc | 1 +
src/box/iproto.cc | 6 ++++++
src/box/iproto.h | 3 +++
3 files changed, 10 insertions(+)
diff --git a/src/box/box.cc b/src/box/box.cc
index 41ba341ee..bf1d5720a 100644
--- a/src/box/box.cc
+++ b/src/box/box.cc
@@ -1661,6 +1661,7 @@ box_free(void)
sequence_free();
gc_free();
engine_shutdown();
+ iproto_socket_free();
wal_free();
}
}
diff --git a/src/box/iproto.cc b/src/box/iproto.cc
index 19a945d2a..3bdb4f2c6 100644
--- a/src/box/iproto.cc
+++ b/src/box/iproto.cc
@@ -2075,3 +2075,9 @@ iproto_set_msg_max(int new_iproto_msg_max)
iproto_do_cfg(&cfg_msg);
cpipe_set_max_input(&net_pipe, new_iproto_msg_max / 2);
}
+
+void
+iproto_socket_free()
+{
+ evio_service_stop(&binary);
+}
\ No newline at end of file
diff --git a/src/box/iproto.h b/src/box/iproto.h
index b9a6cf8f7..6a9627705 100644
--- a/src/box/iproto.h
+++ b/src/box/iproto.h
@@ -80,6 +80,9 @@ iproto_listen(const char *uri);
void
iproto_set_msg_max(int iproto_msg_max);

+void
+iproto_socket_free();
+
#endif /* defined(__cplusplus) */

#endif
-- 
2.17.1

[-- Attachment #2: Type: text/html, Size: 1659 bytes --]

                 reply	other threads:[~2019-02-14 19:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1550172693.644367672@f105.i.mail.ru \
    --to=dmarc-noreply@freelists.org \
    --cc=i.kosarev@corp.mail.ru \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [tarantool-patches] [PATCH] Close socket explicitly before wal_dir at exit' \
    /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