I filed https://issues.apache.org/jira/browse/GEODE-6841 to make this change. We would remove our dependency on the Attach API and Geode would then only use FileProcessController.
Once the Attach API is no longer used "status server --pid=###" will no longer work, so I added a comment to GEODE-6841 indicating that the change is a breaking change requiring us to wait until Geode 2.0. I would expect --dir to only use FileProcessController, but the code you linked clearly uses the pid. Please file a bug and assign it to me. I should be able to fix that quickly. Thanks, Kirk On Thu, Jul 22, 2021 at 3:47 AM Mario Salazar de Torres <mario.salazar.de.tor...@est.tech> wrote: > Hi, > > While doing some tests with cloud-native integration I noticed that if you > try to run "status server --dir=</memberDirectory>" the logic doesn't work > exactly as we would have expected. > > In this use case we are running the command in offline mode. Therefore > ServerLauncher.ServersState.statusWithWorkingDirectory ( > https://github.com/apache/geode/blob/645d3530f8f6a22432afe27c3381fe318ed59654/geode-core/src/main/java/org/apache/geode/distributed/ServerLauncher.java#L1169 > ) is used to resolve the status command, which internally tries to read the > PID member from the PID file and ultimately connect thru the JMX interface. > Thing is that given the command is executed offline and only the working > directory is specified, so I would expect that "FileProcessController" > takes care of the request, rather than "MBeanProcessController", but this > is not the case. > > To fully understand the motivation, you should know that within > "MBeanProcessController" the JMX interface URL is obtained by attaching to > the VM with its PID > In our use case, the problem is that we have 2 containers, 1 for the > member and another for a member watcher, both sharing the member workdir > volume. > And when we try to check the status from the watcher container the request > fails because it tries to attach to the VM using a PID which is not on its > PID namespace. > > So here are my questions: > > * Is this logic working as you expected? > * There is a reason behind this logic? > * Would it be possible to change the logic, so every time "status > server --dir=</memberDirectory>" in offline mode "FileProcessController" is > used? > > Thanks, > Mario >