rhtyd commented on a change in pull request #4144:
URL: https://github.com/apache/cloudstack/pull/4144#discussion_r480958381
##########
File path: usage/src/main/java/com/cloud/usage/UsageManagerImpl.java
##########
@@ -275,7 +277,16 @@ public boolean configure(String name, Map<String, Object>
params) throws Configu
s_logger.error("Unhandled exception configuring UsageManger", e);
throw new ConfigurationException("Unhandled exception configuring
UsageManager " + e.toString());
}
- _pid = Integer.parseInt(System.getProperty("pid"));
+
+ String processName = null;
+ try {
+ processName = ManagementFactory.getRuntimeMXBean().getName();
Review comment:
@div8cn master is on java 11 now, can you use
`ProcessHandle.current().pid()`? I did a quick test:
```
> jshell
| Welcome to JShell -- Version 11.0.7
| For an introduction type: /help intro
jshell> ProcessHandle.current().pid()
$1 ==> 20380
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]