File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,15 +68,11 @@ jobs:
6868 jdk-version : 21
6969
7070 - name : Verify demo config script locates OpenSearch home on Windows
71- # Regression guard for #6023: the tools/*.bat parent-directory walk used
72- # %~dpI on a path ending in "\." which does not ascend, so the script
73- # exited non-zero and OpenSearch failed to start on Windows with no
74- # error output. Run the script natively under cmd.exe (unlike the
75- # bash-invoked path in start-opensearch), with OPENSEARCH_HOME unset so
76- # the home-discovery loop is exercised. The -s flag makes an
77- # already-configured opensearch.yml a benign exit 0 (start-opensearch
78- # already ran the installer), while a home-discovery failure still
79- # exits non-zero from setBaseDir - which is exactly what we guard.
71+ # Regression guard for #6023: run the demo installer natively under
72+ # cmd.exe (start-opensearch invokes it via bash, which hid the bug) with
73+ # OPENSEARCH_HOME unset, so the home-discovery loop must resolve it. -s
74+ # makes an already-configured opensearch.yml exit 0; a discovery failure
75+ # still exits non-zero.
8076 if : ${{ runner.os == 'Windows' }}
8177 shell : cmd
8278 run : |
Original file line number Diff line number Diff line change @@ -6,9 +6,8 @@ if defined OPENSEARCH_HOME goto find_home_done
66set " OPENSEARCH_HOME = %DIR% "
77:find_home
88if exist " %OPENSEARCH_HOME% lib\opensearch-*.jar" goto find_home_done
9- rem Strip the trailing backslash before expanding the parent, otherwise
10- rem %%~dpI on a path ending in "\." resolves to the same directory and the
11- rem loop never ascends (breaks OpenSearch startup on Windows, silently).
9+ rem Strip the trailing "\" first: %%~dpI of "...\dir\." returns "...\dir\"
10+ rem (no ascent), so the loop would never terminate. See #6023.
1211for %%I in (" %OPENSEARCH_HOME:~0 ,-1 % " ) do set " PARENT = %%~dpI "
1312if /I " %PARENT% " == " %OPENSEARCH_HOME% " (
1413 echo Could not locate OpenSearch home. Set OPENSEARCH_HOME manually. 1 >& 2
Original file line number Diff line number Diff line change @@ -6,9 +6,8 @@ if defined OPENSEARCH_HOME goto find_home_done
66set " OPENSEARCH_HOME = %DIR% "
77:find_home
88if exist " %OPENSEARCH_HOME% lib\opensearch-*.jar" goto find_home_done
9- rem Strip the trailing backslash before expanding the parent, otherwise
10- rem %%~dpI on a path ending in "\." resolves to the same directory and the
11- rem loop never ascends (breaks OpenSearch startup on Windows, silently).
9+ rem Strip the trailing "\" first: %%~dpI of "...\dir\." returns "...\dir\"
10+ rem (no ascent), so the loop would never terminate. See #6023.
1211for %%I in (" %OPENSEARCH_HOME:~0 ,-1 % " ) do set " PARENT = %%~dpI "
1312if /I " %PARENT% " == " %OPENSEARCH_HOME% " (
1413 echo Could not locate OpenSearch home. Set OPENSEARCH_HOME manually. 1 >& 2
Original file line number Diff line number Diff line change @@ -7,9 +7,8 @@ if defined OPENSEARCH_HOME goto find_home_done
77set " OPENSEARCH_HOME = %DIR% "
88:find_home
99if exist " %OPENSEARCH_HOME% lib\opensearch-*.jar" goto find_home_done
10- rem Strip the trailing backslash before expanding the parent, otherwise
11- rem %%~dpI on a path ending in "\." resolves to the same directory and the
12- rem loop never ascends (breaks OpenSearch startup on Windows, silently).
10+ rem Strip the trailing "\" first: %%~dpI of "...\dir\." returns "...\dir\"
11+ rem (no ascent), so the loop would never terminate. See #6023.
1312for %%I in (" %OPENSEARCH_HOME:~0 ,-1 % " ) do set " PARENT = %%~dpI "
1413if /I " %PARENT% " == " %OPENSEARCH_HOME% " (
1514 echo Could not locate OpenSearch home. Set OPENSEARCH_HOME manually. 1 >& 2
Original file line number Diff line number Diff line change @@ -6,9 +6,8 @@ if defined OPENSEARCH_HOME goto find_home_done
66set " OPENSEARCH_HOME = %DIR% "
77:find_home
88if exist " %OPENSEARCH_HOME% lib\opensearch-*.jar" goto find_home_done
9- rem Strip the trailing backslash before expanding the parent, otherwise
10- rem %%~dpI on a path ending in "\." resolves to the same directory and the
11- rem loop never ascends (breaks OpenSearch startup on Windows, silently).
9+ rem Strip the trailing "\" first: %%~dpI of "...\dir\." returns "...\dir\"
10+ rem (no ascent), so the loop would never terminate. See #6023.
1211for %%I in (" %OPENSEARCH_HOME:~0 ,-1 % " ) do set " PARENT = %%~dpI "
1312if /I " %PARENT% " == " %OPENSEARCH_HOME% " (
1413 echo Could not locate OpenSearch home. Set OPENSEARCH_HOME manually. 1 >& 2
You can’t perform that action at this time.
0 commit comments