From fa759718929e403cce78e3197e416afa6db8e630 Mon Sep 17 00:00:00 2001
From: Roman Tsisyk <roman@tarantool.org>
Date: Tue, 15 Aug 2017 11:06:33 +0300
Subject: [PATCH] Ignore tarantool_free() from non-main thread

panic() from non-main thread calls exit(), which fires
at_exit triggers, which try to destroy TX data.

Closes #2686
---
 src/main.cc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/main.cc b/src/main.cc
index e70a9430a2..c593f83848 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -461,6 +461,13 @@ tarantool_free(void)
 	if (getpid() != master_pid)
 		return;
 
+	/*
+	 * It's better to do nothing and keep xlogs opened when
+	 * we are called by exit() from a non-main thread.
+	 */
+	if (!cord_is_main())
+		return;
+
 	/* Shutdown worker pool. Waits until threads terminate. */
 	coio_shutdown();
 
-- 
GitLab