Skip to content

Commit e1a7e92

Browse files
committed
Add 'use_unix_sockets_iproto' option to core = app
Added the new 'use_unix_sockets_iproto' option, which enabled unix sockets for iproto connections for core = app. It helped to handle the problem with 'Address already in use' error. Part of Tarantool #4459
1 parent 6edb58f commit e1a7e92

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/app_server.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from lib.tarantool_server import TarantoolStartError
1515
from lib.utils import find_port
1616
from lib.utils import format_process
17+
from lib.utils import warn_unix_socket
1718
from test import TestRunGreenlet, TestExecutionError
1819

1920

@@ -69,6 +70,7 @@ def __init__(self, _ini=None, test_suite=None):
6970
self.name = 'app_server'
7071
self.process = None
7172
self.binary = TarantoolServer.binary
73+
self.use_unix_sockets_iproto = ini['use_unix_sockets_iproto']
7274

7375
@property
7476
def logfile(self):
@@ -103,7 +105,12 @@ def deploy(self, vardir=None, silent=True, need_init=True):
103105
if (e.errno == errno.ENOENT):
104106
continue
105107
raise
106-
os.putenv("LISTEN", str(find_port()))
108+
if self.use_unix_sockets_iproto:
109+
path = os.path.join(self.vardir, self.name + ".socket-iproto")
110+
warn_unix_socket(path)
111+
os.putenv("LISTEN", str(path))
112+
else:
113+
os.putenv("LISTEN", str(find_port()))
107114
shutil.copy(os.path.join(self.TEST_RUN_DIR, 'test_run.lua'),
108115
self.vardir)
109116

0 commit comments

Comments
 (0)