Skip to content

IoTDB Edge: stop-edge.bat ignores IOTDB_HOME, while start-edge.bat honours it #19005

Open

Description

@PDGGK

start-edge.bat keeps an IOTDB_HOME taken from the environment and passes it to the JVM as -DIOTDB_HOME="...":

pushd "%~dp0..\.."
if NOT DEFINED IOTDB_HOME set "IOTDB_HOME=%cd%"

set iotdb_parms=%iotdb_parms% -DIOTDB_HOME="%IOTDB_HOME%"

stop-edge.bat always sets IOTDB_HOME to the installation it belongs to, and only stops a java.exe whose command line contains -DIOTDB_HOME= followed by exactly that string:

pushd "%~dp0\..\.."
set "IOTDB_HOME=%cd%"
popd
powershell -NoProfile -Command "$ErrorActionPreference='Stop'; $plain='-DIOTDB_HOME=' + $env:IOTDB_HOME; $quoted='-DIOTDB_HOME=' + [char]34 + $env:IOTDB_HOME + [char]34; Get-CimInstance Win32_Process -Filter \"name='java.exe'\" | Where-Object { $line=$_.CommandLine; $sameHome=$line -and ($line.Contains($plain + ' ') -or $line.EndsWith($plain) -or $line.Contains($quoted + ' ') -or $line.EndsWith($quoted)); $sameHome -and $line.Contains('org.apache.iotdb.edge.EdgeNode') } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force; Write-Host ('IoTDB Edge process ' + $_.ProcessId + ' stopped.') }"

So when the node was started with IOTDB_HOME set to another path to the same directory, such as a symbolic link or a junction, stop-edge.bat does not match the process. This is the Windows side of #18545. The Unix scripts are being changed in #18546, where both scripts now derive IOTDB_HOME with one shared function.

This came up in the review of #18546. I do not have a Windows machine and have not run these scripts; the above is from reading them.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions