Skip to content

Free port auto resolving for TarantoolServer and AppServer #348

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

Merged
merged 7 commits into from
Sep 12, 2022

Conversation

ylobankov
Copy link
Contributor

@ylobankov ylobankov commented Sep 1, 2022

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.

The same for AppServer, 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.

Fixes #141

@ylobankov ylobankov force-pushed the ylobankov/fix-ports-issue branch 7 times, most recently from d036900 to 67c900a Compare September 7, 2022 12:52
@ylobankov ylobankov requested a review from Totktonada September 7, 2022 12:52
@ylobankov ylobankov force-pushed the ylobankov/fix-ports-issue branch 3 times, most recently from 8e7be49 to ac5ce49 Compare September 7, 2022 15:27
Copy link
Member

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on the ancient (but painful) problem!

I'm okay on the high level. I see a potential problem with the create server command, it should be handled somehow (see details in the comment above).

Also left several stylistic thoughts, but they're not crucial to fix.

I just looked at the code and lean on you in performing a thorough testing on tarantool and vshard test suites.

(I'm going to a vacation and can't participate in the next review iteration.)

@ylobankov ylobankov force-pushed the ylobankov/fix-ports-issue branch 6 times, most recently from 7cee77a to fa93d69 Compare September 12, 2022 17:19
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
Some tests may require this feature if they are switched to using Unix
sockets for such a connection in the future. Anyway, this change doesn't
make worse.
@ylobankov ylobankov force-pushed the ylobankov/fix-ports-issue branch from fa93d69 to dcc23f6 Compare September 12, 2022 17:29
@ylobankov ylobankov merged commit 4bac867 into master Sep 12, 2022
@ylobankov ylobankov deleted the ylobankov/fix-ports-issue branch September 12, 2022 17:40
ylobankov added a commit to tarantool/tarantool that referenced this pull request Sep 12, 2022
Bump test-run to new version with the following improvements:

- Report job summary on GitHub Actions [1]
- Free port auto resolving for TarantoolServer and AppServer [2]

[1] tarantool/test-run#341
[2] tarantool/test-run#348

NO_DOC=testing stuff
NO_TEST=testing stuff
NO_CHANGELOG=testing stuff
ylobankov added a commit to tarantool/tarantool that referenced this pull request Sep 12, 2022
Bump test-run to new version with the following improvements:

- Report job summary on GitHub Actions [1]
- Free port auto resolving for TarantoolServer and AppServer [2]

Also, this patch includes the following changes:

- removing `use_unix_sockets` option from all suite.ini config files
  due to permanent using Unix sockets for admin connection recently
  introduced in test-run
- switching replication-py tests to Unix sockets for iproto connection
- fixing replication-py/swap.test.py and swim/swim.test.lua tests

[1] tarantool/test-run#341
[2] tarantool/test-run#348

NO_DOC=testing stuff
NO_TEST=testing stuff
NO_CHANGELOG=testing stuff
kyukhin pushed a commit to tarantool/tarantool that referenced this pull request Sep 13, 2022
Bump test-run to new version with the following improvements:

- Report job summary on GitHub Actions [1]
- Free port auto resolving for TarantoolServer and AppServer [2]

Also, this patch includes the following changes:

- removing `use_unix_sockets` option from all suite.ini config files
  due to permanent using Unix sockets for admin connection recently
  introduced in test-run
- switching replication-py tests to Unix sockets for iproto connection
- fixing replication-py/swap.test.py and swim/swim.test.lua tests

[1] tarantool/test-run#341
[2] tarantool/test-run#348

NO_DOC=testing stuff
NO_TEST=testing stuff
NO_CHANGELOG=testing stuff
ylobankov added a commit to tarantool/tarantool that referenced this pull request Sep 13, 2022
Bump test-run to new version with the following improvements:

- Report job summary on GitHub Actions [1]
- Free port auto resolving for TarantoolServer and AppServer [2]

Also, this patch includes the following changes:

- removing `use_unix_sockets` option from all suite.ini config files
  due to permanent using Unix sockets for admin connection recently
  introduced in test-run
- switching replication-py tests to Unix sockets for iproto connection
- fixing replication-py/swap.test.py and swim/swim.test.lua tests

[1] tarantool/test-run#341
[2] tarantool/test-run#348

NO_DOC=testing stuff
NO_TEST=testing stuff
NO_CHANGELOG=testing stuff

(cherry picked from commit 4335b44)
kyukhin pushed a commit to tarantool/tarantool that referenced this pull request Sep 13, 2022
Bump test-run to new version with the following improvements:

- Report job summary on GitHub Actions [1]
- Free port auto resolving for TarantoolServer and AppServer [2]

Also, this patch includes the following changes:

- removing `use_unix_sockets` option from all suite.ini config files
  due to permanent using Unix sockets for admin connection recently
  introduced in test-run
- switching replication-py tests to Unix sockets for iproto connection
- fixing replication-py/swap.test.py and swim/swim.test.lua tests

[1] tarantool/test-run#341
[2] tarantool/test-run#348

NO_DOC=testing stuff
NO_TEST=testing stuff
NO_CHANGELOG=testing stuff

(cherry picked from commit 4335b44)
ylobankov added a commit to tarantool/tarantool that referenced this pull request Sep 15, 2022
Bump test-run to new version with the following improvements:

- Report job summary on GitHub Actions [1]
- Free port auto resolving for TarantoolServer and AppServer [2]

Also, this patch includes the following changes:

- removing `use_unix_sockets` option from all suite.ini config files
  due to permanent using Unix sockets for admin connection recently
  introduced in test-run
- switching replication-py tests to Unix sockets for iproto connection
- fixing replication-py/swap.test.py and swim/swim.test.lua tests

[1] tarantool/test-run#341
[2] tarantool/test-run#348

NO_DOC=testing stuff
NO_TEST=testing stuff
NO_CHANGELOG=testing stuff

(cherry picked from commit 4335b44)
ylobankov added a commit to tarantool/tarantool that referenced this pull request Sep 15, 2022
Bump test-run to new version with the following improvements:

- Report job summary on GitHub Actions [1]
- Free port auto resolving for TarantoolServer and AppServer [2]

Also, this patch includes the following changes:

- removing `use_unix_sockets` option from all suite.ini config files
  due to permanent using Unix sockets for admin connection recently
  introduced in test-run
- switching replication-py tests to Unix sockets for iproto connection
- fixing replication-py/swap.test.py and swim/swim.test.lua tests

[1] tarantool/test-run#341
[2] tarantool/test-run#348

NO_DOC=testing stuff
NO_TEST=testing stuff
NO_CHANGELOG=testing stuff

(cherry picked from commit 4335b44)
ylobankov added a commit to tarantool/tarantool that referenced this pull request Sep 15, 2022
Bump test-run to new version with the following improvements:

- Report job summary on GitHub Actions [1]
- Free port auto resolving for TarantoolServer and AppServer [2]

Also, this patch includes the following changes:

- removing `use_unix_sockets` option from all suite.ini config files
  due to permanent using Unix sockets for admin connection recently
  introduced in test-run
- switching replication-py tests to Unix sockets for iproto connection
- fixing replication-py/swap.test.py test

[1] tarantool/test-run#341
[2] tarantool/test-run#348

NO_DOC=testing stuff
NO_TEST=testing stuff
NO_CHANGELOG=testing stuff

(cherry picked from commit 4335b44)
ylobankov added a commit to tarantool/tarantool that referenced this pull request Sep 15, 2022
Bump test-run to new version with the following improvements:

- Report job summary on GitHub Actions [1]
- Free port auto resolving for TarantoolServer and AppServer [2]

Also, this patch includes the following changes:

- removing `use_unix_sockets` option from all suite.ini config files
  due to permanent using Unix sockets for admin connection recently
  introduced in test-run
- switching replication-py tests to Unix sockets for iproto connection
- fixing replication-py/swap.test.py test

[1] tarantool/test-run#341
[2] tarantool/test-run#348

NO_DOC=testing stuff
NO_TEST=testing stuff
NO_CHANGELOG=testing stuff

(cherry picked from commit 4335b44)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix 'Address already in use' error with TCP sockets
2 participants