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

Mac $TMPDIR length fights with max Unix socket length #3591

glasser opened this issue Jan 29, 2015 · 1 comment

Mac $TMPDIR length fights with max Unix socket length #3591

glasser opened this issue Jan 29, 2015 · 1 comment


Copy link

glasser commented Jan 29, 2015

Unix domain socket names can be at most ~104 bytes. (104 on Mac, 108 on Linux.)

On Mac, $TMPDIR is something like /var/folders/2k/tmccc7sj7pg2c0qt6646cz8r0000gn/T/, length 49.

This means that something like /var/folders/2k/tmccc7sj7pg2c0qt6646cz8r0000gn/T/meteor-test-runx8zsw4/.meteor/local/shell/shell.sock is too long.

I think @stubailo 's work that is going to merge soon might shorten some bits of this anyway, but for now this seems to result in (at the least) a weirdly truncated socket filename. (It still does work, as long as the truncation still leaves a file in the right subdirectory instead of the subdirectory name itself.)

Copy link
Contributor Author

glasser commented Jan 30, 2015

Actually, this probably is causing occasional

W20150129-16:49:16.872(-8)? (STDERR) Unable to listen for `meteor shell` connections: Error: listen EADDRINUSE

errors too, because the unlink is being aimed at a different file than the bind/connect!

@benjamn benjamn self-assigned this Jan 30, 2015
@benjamn benjamn closed this as completed in 75f86e1 Feb 5, 2015
benjamn added a commit that referenced this issue Feb 5, 2015
This eliminates a whole class of problems relating to socket files (such
as the limit on the length of their names), and potentially makes it
easier to implement `meteor shell` on other platforms, such as Windows.

Fixes #3591.

Test Plan:
Use `meteor shell` and verify that it still works as before, especially
when started before/after/during server startup, and when the server is
killed while multiple shell clients are connected.

Reviewers: Slava, dgreensp, stubailo, glasser

Reviewed By: glasser

Differential Revision:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants