-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add domain socket max path length check #18015
base: master-2.x
Are you sure you want to change the base?
Add domain socket max path length check #18015
Conversation
@gp1314 is it more for log readability? |
Yes, it seems that java15 and below can only get the domain socket max path length of the environment through the JNI method |
2fec0ec
to
b597c61
Compare
@@ -28,6 +28,9 @@ public final class OSUtils { | |||
public static final String JAVA_VENDOR_NAME = System.getProperty("java.vendor"); | |||
/** Indicates the current java vendor is IBM java or not. */ | |||
public static final boolean IBM_JAVA = JAVA_VENDOR_NAME.contains("IBM"); | |||
/** The maximum path length supported by a domain socket on unix varies depending on the | |||
* operating system. The conservative limit is returned here */ |
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.
* operating system. The conservative limit is returned here */ | |
* operating system. The conservative limit is returned here. */ |
@@ -28,6 +28,9 @@ public final class OSUtils { | |||
public static final String JAVA_VENDOR_NAME = System.getProperty("java.vendor"); | |||
/** Indicates the current java vendor is IBM java or not. */ | |||
public static final boolean IBM_JAVA = JAVA_VENDOR_NAME.contains("IBM"); | |||
/** The maximum path length supported by a domain socket on unix varies depending on the | |||
* operating system. The conservative limit is returned here */ | |||
public static final int UNIX_SOCKET_MAX_PATH_LENGTH = 100; |
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.
Isn't it 108, why set it to 100?
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.
There are differences in the maximum length of domain socket paths among different operating systems. Therefore, it is recommended to limit the length of the socket path to the smallest common length range, such as around 100 characters.
should this be pushing to |
Automated checks report:
Some checks failed. Please fix the reported issues and reply |
a007052
to
b916f87
Compare
Automated checks report:
All checks passed! |
What changes are proposed in this pull request?
Why are the changes needed?