dongjoon-hyun commented on code in PR #51476:
URL: https://github.com/apache/spark/pull/51476#discussion_r2209121216
##########
common/network-common/src/main/java/org/apache/spark/network/server/TransportServer.java:
##########
@@ -105,11 +104,13 @@ private void init(String hostToBind, int portToBind) {
EventLoopGroup workerGroup = NettyUtils.createEventLoop(ioMode,
conf.serverThreads(),
conf.getModuleName() + "-server");
+ String name = System.getProperty("os.name");
+ boolean isNotWindows = 7 > name.length() || !name.regionMatches(true, 0,
"Windows", 0, 7);
Review Comment:
The logic is originated from `commons-lang3` logic and I also thought like
you initially and omitted in the first commit. However, as Liang-Chi pointed
here (https://github.com/apache/spark/pull/51476#discussion_r2205671366), we
need it because `regionMatches` checks within the length of the shortest one.
```
$ jshell
| Welcome to JShell -- Version 21.0.7
| For an introduction type: /help intro
jshell> "Win".regionMatches(true, 0, "Windows", 0, 1)
$1 ==> true
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]