weizhouapache commented on a change in pull request #4144:
URL: https://github.com/apache/cloudstack/pull/4144#discussion_r481904326
##########
File path: usage/src/main/java/com/cloud/usage/UsageManagerImpl.java
##########
@@ -280,8 +278,7 @@ public boolean configure(String name, Map<String, Object>
params) throws Configu
String processName = null;
try {
- processName = ManagementFactory.getRuntimeMXBean().getName();
- _pid = Integer.parseInt(processName.split("@")[0]);
+ _pid = (int) ProcessHandle.current().pid();
} catch (Exception e) {
String msg = String.format("Unable to get process Id for %s!",
processName);
Review comment:
processName is always null .
----------------------------------------------------------------
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]