Skip to content
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

Tarantool 3 config instance fails to use 108 symbols control socket on tt start #834

Closed
DifferentialOrange opened this issue May 3, 2024 · 1 comment · Fixed by #838
Closed

Comments

@DifferentialOrange
Copy link
Member

DifferentialOrange commented May 3, 2024

The case is follows.

I had created an application based on tt create vshard_cluster template. Application path is as follows: /home/moiseevgeorgy/Development/sandbox/t3-app/cluster-app. Then I've tried to start an application, and got the following status:

INSTANCE                      STATUS          PID
cluster-app:storage-002-a     RUNNING         161460
cluster-app:storage-002-b     RUNNING         161461
cluster-app:router-001-a      NOT RUNNING     
cluster-app:storage-001-a     RUNNING         161458
cluster-app:storage-001-b     RUNNING         161459
LuajitError: builtin/config/applier/console.lua:40: builtin/box/console.lua:1011: failed to create server unix/:/home/moiseevgeorgy/Development/sandbox/instances.enabled/cluster-app/var/run/router-001-a/tarantool.control: No buffer space available

"No buffer space available" is an error often associated with "too long UNIX socket path". At the same time everything is fine with storage instances, even though their socket path is expected to be 1 symbol longer. The difference is as follows.

storage instances had received the following TT_CONSOLE_SOCKET_DEFAULT:

var/run/storage-001-a/tarantool.control
var/run/storage-001-b/tarantool.control
var/run/storage-002-a/tarantool.control
var/run/storage-002-b/tarantool.control

and router instance had received the following one:

/home/moiseevgeorgy/Development/sandbox/instances.enabled/cluster-app/var/run/router-001-a/tarantool.control

The reason of this difference is as follows. A router full socket path is 108 symbols, which is considered to be ok for Linux, thus it doesn't shortened. A storage full socket path is 109 symbols, which exceeds this limit and is transformed to be relative.

maxSocketPathLinux = 108

if err := verifySocketLength(socketPath); err == nil {
return socketPath, nil
}

On the other hand, while working with admin socket, Tarantool adds unix/: or unix/:./ before the path (see source code) and then connect fails (see source code).

The workaround is rather easy: either make socket path longer or shorter. The proper solution is seems to be "consider additional Tarantool pads while trying to shorten the path", but we may give it a second thought.

@DifferentialOrange DifferentialOrange changed the title Tarantool 3 config instance fails to use 108 symbols control socket Tarantool 3 config instance fails to use 108 symbols control socket on tt start May 3, 2024
@Totktonada
Copy link
Member

unix/: shouldn't be taken into account at the length check on the tarantool side, because it is not placed into struct sockaddr_un.

BTW, the real tarantool side max path length for a Unix domain socket is 107 on Linux and 103 on Mac OS. See tarantool/tarantool#4634 for details.

psergee added a commit that referenced this issue May 6, 2024
Tarantool adds a prefix to the console socket path. Take this
prefix into account when checking for possible socket path overflows.

Closes #834
psergee added a commit that referenced this issue May 6, 2024
psergee added a commit that referenced this issue May 6, 2024
psergee added a commit that referenced this issue May 6, 2024
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 a pull request may close this issue.

2 participants