-
Notifications
You must be signed in to change notification settings - Fork 17
Fix 'Address already in use' error with TCP sockets #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
NB: |
Related: PR #210. |
Support 'use_unix_sockets_iproto' suite.ini option in 'core = app' test suites. It'll allow to workaround TCP port choosing race (see more in [1]) by using Unix sockets instead of TCP ones: we did the same for 'core = tarantool' test suites in [2]. [1]: tarantool/test-run#141 [2]: 60f84cb ('test: use unix sockets for iproto connections') Part of #4459.
Support 'use_unix_sockets_iproto' suite.ini option in 'core = app' test suites. It'll allow to workaround TCP port choosing race (see more in [1]) by using Unix sockets instead of TCP ones: we did the same for 'core = tarantool' test suites in [2]. [1]: tarantool/test-run#141 [2]: 60f84cb ('test: use unix sockets for iproto connections') Part of #4459. (cherry picked from commit b7b9a59)
Support 'use_unix_sockets_iproto' suite.ini option in 'core = app' test suites. It'll allow to workaround TCP port choosing race (see more in [1]) by using Unix sockets instead of TCP ones: we did the same for 'core = tarantool' test suites in [2]. [1]: tarantool/test-run#141 [2]: 60f84cb ('test: use unix sockets for iproto connections') Part of #4459. (cherry picked from commit b7b9a59)
Support 'use_unix_sockets_iproto' suite.ini option in 'core = app' test suites. It'll allow to workaround TCP port choosing race (see more in [1]) by using Unix sockets instead of TCP ones: we did the same for 'core = tarantool' test suites in [2]. [1]: tarantool/test-run#141 [2]: 60f84cb ('test: use unix sockets for iproto connections') Part of #4459. (cherry picked from commit b7b9a59)
Hmm.. strange, for me it looks like
Anyways, letting the Tarantool instance to pick a port by itself looks way more robust, since no delay between assigning a port and binding it. |
@sergos It is because tarantool/tarantool#4620 was fixed. I filed this issue against tarantool specifically to have a change to use it here, in test-run. |
To exclude the chance to encounter the tarantool/test-run#141 issue in replication-py tests let's switch to using unix sockets instead of TCP ports. NO_DOC=testing stuff NO_TEST=testing stuff NO_CHANGELOG=testing stuff
To reduce the chance to encounter the tarantool/test-run#141 issue in tests let's switch to using unix sockets instead of TCP ports where it is possible. NO_DOC=testing stuff NO_TEST=testing stuff NO_CHANGELOG=testing stuff
To reduce the chance to encounter the tarantool/test-run#141 issue in replication-py/swim tests, let's switch to using unix sockets instead of TCP ports for tarantool console. NO_DOC=testing stuff NO_TEST=testing stuff NO_CHANGELOG=testing stuff
To reduce the chance to encounter the tarantool/test-run#141 issue in replication-py/swim tests, let's switch to using unix sockets instead of TCP ports for tarantool console. NO_DOC=testing stuff NO_TEST=testing stuff NO_CHANGELOG=testing stuff
To reduce the chance to encounter the tarantool/test-run#141 issue in replication-py/swim tests, let's switch to using unix sockets instead of TCP ports for tarantool console. NO_DOC=testing stuff NO_TEST=testing stuff NO_CHANGELOG=testing stuff
To reduce the chance to encounter the tarantool/test-run#141 issue in replication-py/swim tests, let's switch to using unix sockets instead of TCP ports for tarantool console. NO_DOC=testing stuff NO_TEST=testing stuff NO_CHANGELOG=testing stuff (cherry picked from commit cb6fc4a)
To reduce the chance to encounter the tarantool/test-run#141 issue in replication-py tests, let's switch to using unix sockets instead of TCP ports for tarantool console. NO_DOC=testing stuff NO_TEST=testing stuff NO_CHANGELOG=testing stuff (cherry picked from commit cb6fc4a)
Detect specific failure reasons first. If none found in the whole log, look for generic. This way, specific reasons aren't overshadowed by generic ones, when those are found first in the logs. Introduce one specific reason: "Address already in use", subject of tarantool/test-run#141
Detect specific failure reasons first. If none found in the whole log, look for generic. This way, specific reasons aren't overshadowed by generic ones, when those are found first in the logs. Introduce one specific reason: "Address already in use", subject of tarantool/test-run#141
Detect specific failure reasons first. If none found in the whole log, look for generic. This way, specific reasons aren't overshadowed by generic ones, when those are found first in the logs. Introduce one specific reason: "Address already in use", subject of tarantool/test-run#141
Detect specific failure reasons first. If none found in the whole log, look for generic. This way, specific reasons aren't overshadowed by generic ones, when those are found first in the logs. Introduce one specific reason: "Address already in use", subject of tarantool/test-run#141
To reduce the chance to encounter the tarantool/test-run#141 issue in replication-py/swim tests, let's switch to using unix sockets instead of TCP ports for tarantool console. NO_DOC=testing stuff NO_TEST=testing stuff NO_CHANGELOG=testing stuff
This patch makes test-run use only Unix sockets for admin console connection. The feature to use TCP sockets for it is dropped. Actually, admin console connection is a purely internal thing of test-run, and we can use what is more convenient for such a connection. Using only Unix sockets gives us significant advantages over TCP sockets like connection speed and eliminating issue with getting a free port for TCP connection. Part of #141
This change replaces manual choosing an iproto port for TarantoolServer by the auto resolving mechanism. In two words, test-run always provides '127.0.0.1:0' as a value for LISTEN env variable that is used in a lua file to start a tarantool instance. In this way, the port will be picked automatically, and we are getting the real value of it via the admin console by executing `box.info.listen` that is available for tarantool version >= 2.4.1, and special lua script intended for tarantool version < 2.4.1. Part of #141
This change replaces manual choosing a free iproto port for AppServer by the auto resolving mechanism. In two words, test-run always provides '127.0.0.1:0' as a value for LISTEN env variable that is used in a lua test script. In this way, the iproto port will be picked automatically, but if the test needs the real value of the port, it has to execute `box.info.listen` for tarantool version >= 2.4.1, or other lua code for tarantool version < 2.4.1. Part of #141
Now this functionality is not needed anymore due to added free port auto resolving mechanism. Part of #141
Now these functions are not needed anymore due to added free port auto resolving mechanism. Closes #141
This patch makes test-run use only Unix sockets for admin console connection. The feature to use TCP sockets for it is dropped. Actually, admin console connection is a purely internal thing of test-run, and we can use what is more convenient for such a connection. Using only Unix sockets gives us significant advantages over TCP sockets like connection speed and eliminating issue with getting a free port for TCP connection. Part of #141
This change replaces manual choosing an iproto port for TarantoolServer by the auto resolving mechanism. In two words, test-run always provides '127.0.0.1:0' as a value for LISTEN env variable that is used in a lua file to start a tarantool instance. In this way, the port will be picked automatically, and we are getting the real value of it via the admin console by executing `box.info.listen` that is available for tarantool version >= 2.4.1, and special lua script intended for tarantool version < 2.4.1. Part of #141
This change replaces manual choosing a free iproto port for AppServer by the auto resolving mechanism. In two words, test-run always provides '127.0.0.1:0' as a value for LISTEN env variable that is used in a lua test script. In this way, the iproto port will be picked automatically, but if the test needs the real value of the port, it has to execute `box.info.listen` for tarantool version >= 2.4.1, or other lua code for tarantool version < 2.4.1. Part of #141
Now this functionality is not needed anymore due to added free port auto resolving mechanism. Part of #141
Now these functions are not needed anymore due to added free port auto resolving mechanism. Closes #141
This patch makes test-run use only Unix sockets for admin console connection. The feature to use TCP sockets for it is dropped. Actually, admin console connection is a purely internal thing of test-run, and we can use what is more convenient for such a connection. Using only Unix sockets gives us significant advantages over TCP sockets like connection speed and eliminating issue with getting a free port for TCP connection. Part of #141
This change replaces manual choosing an iproto port for TarantoolServer by the auto resolving mechanism. In two words, test-run always provides '127.0.0.1:0' as a value for LISTEN env variable that is used in a lua file to start a tarantool instance. In this way, the port will be picked automatically, and we are getting the real value of it via the admin console by executing `box.info.listen` that is available for tarantool version >= 2.4.1, and special lua script intended for tarantool version < 2.4.1. Part of #141
This change replaces manual choosing a free iproto port for AppServer by the auto resolving mechanism. In two words, test-run always provides '127.0.0.1:0' as a value for LISTEN env variable that is used in a lua test script. In this way, the iproto port will be picked automatically, but if the test needs the real value of the port, it has to execute `box.info.listen` for tarantool version >= 2.4.1, or other lua code for tarantool version < 2.4.1. Part of #141
Now this functionality is not needed anymore due to added free port auto resolving mechanism. Part of #141
Now these functions are not needed anymore due to added free port auto resolving mechanism. Closes #141
This patch improves getting the iproto port for tarantool < 2.4.1. The previous revision of the lua script might give unstable result (more than 1 port) and test-run failed. Now it is fixed. Follows up #141
This patch improves getting the iproto port for tarantool < 2.4.1. The previous revision of the lua script might give unstable result (more than 1 port) and test-run failed. Now it is fixed. Follows up #141
I have some problems with ports when I use luatest with tarantool |
TcpPortDispatcher was introduced to eliminate the race condition when two workers trying to use the same port: the idea is that each worker use its own ports range. Really these ports could race with client ports (from, say, net.box or replication), which typically don't use bind() and so binds to a random available port (despite any dispatched ranges). So this approach is broken by design.
There is the workaround with
use_unix_sockets
anduse_unix_sockets_iproto
options: setting them toTrue
should eliminate the problem. However it is possible that some tests are designed to test tcp connections, so I think we should fix the problem.The way I see is no-bind / bind to zero port and grep logs for a LISTEN / CONSOLE port (or write it from a script to a predefined location). Remove TcpPortDispatcher and find_port() at all.
Hmm,
box.cfg{listen = 0}
showsbinary: bound to 0.0.0.0:0
. Need to elaborate how to get the port.The discussion had initially arisen in #115.
The text was updated successfully, but these errors were encountered: