Skip to content

Commit

Permalink
Fix pqcheck and pqrepair on Windows (#17210)
Browse files Browse the repository at this point in the history
A recent change to pqheck, attempted to address an issue where the
pqcheck would not on Windows mahcines when located in a folder containing
a space, such as "C:\program files\elastic\logstash". While this fixed an
issue with spaces in folders, it introduced a new issue related to Java options,
and the pqcheck was still unable to run on Windows.

This PR attempts to address the issue, by removing the quotes around the Java options,
which caused the option parsing to fail, and instead removes the explicit setting of
the classpath - the use of `set CLASSPATH=` in the `:concat` function is sufficient
to set the classpath, and should also fix the spaces issue

Fixes: #17209
  • Loading branch information
robbavey authored Mar 5, 2025
1 parent 1e06eea commit ba5f215
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/pqcheck.bat
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ for %%i in ("%LS_HOME%\logstash-core\lib\jars\*.jar") do (
call :concat "%%i"
)

"%JAVACMD%" "%JAVA_OPTS%" -cp "%CLASSPATH%" org.logstash.ackedqueue.PqCheck %*
"%JAVACMD%" %JAVA_OPTS% org.logstash.ackedqueue.PqCheck %*

:concat
IF not defined CLASSPATH (
Expand Down
2 changes: 1 addition & 1 deletion bin/pqrepair.bat
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ for %%i in ("%LS_HOME%\logstash-core\lib\jars\*.jar") do (
call :concat "%%i"
)

"%JAVACMD%" %JAVA_OPTS% -cp "%CLASSPATH%" org.logstash.ackedqueue.PqRepair %*
"%JAVACMD%" %JAVA_OPTS% org.logstash.ackedqueue.PqRepair %*

:concat
IF not defined CLASSPATH (
Expand Down

0 comments on commit ba5f215

Please sign in to comment.