-
Notifications
You must be signed in to change notification settings - Fork 5k
[Spike] Use Unix domain sockets in FileLockCommunicator #31856
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
Conversation
b330a46
to
0a3f978
Compare
// TODO: Where to put domain sockets? If we put them in gradleUserHomeDir, we can get | ||
// java.net.SocketException: Unix domain path too long | ||
File unixDomainSocketsDir = new File("/tmp/gradle"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure where macOS expects them, but the Linux standard is to put these things in $XDG_RUNTIME_DIR
or failing that $TMPDIR
.
Looking at https://github.com/dirs-dev/directories-jvm/blob/main/src/main/java/dev/dirs/ProjectDirectories.java#L237, it seems like there's no equivalent directory for macOS/Windows.
So I think using $XDG_RUNTIME_DIR/gradle
on Linux if possible, and using the actual temporary directory ${java.io.tmpdir}/gradle
otherwise, would be the best option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking in to that! It might make more sense to use that. 🤔
Note that I checked System.getProperty("java.io.tmpdir")
value and it looks like it can be long path too, e.g. /Users/asodja/workspace/gradle/subprojects/core/build/tmp
for some tests when running locally.
So maybe we need a different fallback. I wonder what location others use, e.g. I know Docker uses docker.sock
fb4db64
to
b009470
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If you don't want the stale bot to close it, then set a milestone for it. |
This pull request has been automatically closed due to inactivity. |
Adjust tests to work with UnixDomainSocketFileCommunicatorProvider Handle cases where we have multiple instances of UnixDomainSocketFileLockCommunicator
b009470
to
18f38a7
Compare
@bot-gradle test this |
This comment has been minimized.
This comment has been minimized.
The following builds have failed: |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If you don't want the stale bot to close it, then set a milestone for it. |
This pull request has been automatically closed due to inactivity. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If you don't want the stale bot to close it, then set a milestone for it. |
This pull request has been automatically closed due to inactivity. |
Relates to #31394