PDGGK opened a new pull request, #18546:
URL: https://github.com/apache/iotdb/pull/18546

   ## Description
   
   Fixes #18545.
   
   `start-edge.sh` honours an `IOTDB_HOME` taken from the environment and 
passes that
   value to the JVM as `-DIOTDB_HOME=...`. `stop-edge.sh` recomputed 
`IOTDB_HOME`
   from its own location and matched the process command line against that 
string,
   so when the two differed it declined to act on its own process, exited 0, and
   removed the PID file. A service manager saw a successful stop while the 
process
   kept running; the following `ExecStart` then found the ports occupied and 
also
   exited 0, so a configuration change silently never took effect.
   
   ### The change
   
   `stop-edge.sh` now honours `IOTDB_HOME` the same way `start-edge.sh` does, 
and
   adds a resolved-path comparison as a fallback:
   
   - the original literal comparison is tried first and is unchanged, so any 
command
     line that matched before still matches;
   - only when it does not hit does the script extract the value of 
`-DIOTDB_HOME=`
     and compare it with `IOTDB_HOME` after resolving both with `cd ... && pwd 
-P`.
   
   The change is additive: it can recognise more processes than before, never 
fewer.
   
   ### Behavioural note
   
   This widens the identity test from "the same path string" to "the same 
resolved
   directory", so two different symlinks pointing at one installation now count 
as
   the same installation. That seems to be the intent of the check, but it is a
   semantic change and worth a second opinion.
   
   ### Verification
   
   Four start/stop environment combinations, each from a fresh extraction of the
   packaged Edge archive, with `$ROOT/iotdb` symlinked to the install directory.
   Every row was confirmed to have `10710` actually listening before the stop 
was
   issued, so a row cannot pass by the process having died on its own:
   
   ```
   start with IOTDB_HOME   stop with IOTDB_HOME   before          after
   ----------------------  ---------------------  --------------  --------------
   symlink                 real path              still running   stopped
   symlink                 unset                  still running   stopped
   unset                   symlink                stopped         stopped
   unset                   unset                  stopped         stopped
   ```
   
   The two rows that fail before the change are exactly the ones where
   `start-edge.sh` was given an `IOTDB_HOME` that differs from the path the 
script
   derives.
   
   Also re-ran the restart sequence from the issue after the change: the stop 
now
   terminates the process, the following start comes up on the edited 
`dn_rpc_port`,
   and the old port is released.
   
   Built and run on macOS with JDK 22, from the packaged
   `apache-iotdb-2.0.11-SNAPSHOT-edge-bin.zip`.
   
   ### Not changed
   
   `scripts/sbin/windows/stop-edge.bat:23` sets `IOTDB_HOME` unconditionally 
while
   `start-edge.bat:65` honours the environment, which is the same shape. I have 
no
   Windows machine and did not run it, so I have left it alone rather than 
propose an
   untested change.
   


-- 
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]

Reply via email to