-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix for java.lang.RuntimeException: Couldn’t get PID of Grakn. Received ' #2815
Conversation
what could go wrong? |
|
||
String pidString = outputS.toString().trim(); | ||
String[] pidAndHostnameString = ManagementFactory.getRuntimeMXBean().getName().split("@"); | ||
String pidString = pidAndHostnameString[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know how portability is affected? isn't the name platform-specific? That's what the RuntimeMXBean
spec says.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kasper-piskorski There exists no platform-independent way that can be guaranteed to work in all jvm implementations. ManagementFactory.getRuntimeMXBean().getName() looks like the best (closest) solution. It's short, and probably works in every implementation in wide use.
On linux+windows it returns a value like 12345@hostname (12345 being the process id).
* fix gc launcher link and add extra comment (#2794) * Removes uses of "<role_name> sub role" in docs examples, moving to "as" syntax (#2785) Explicitly defining role hierarchies is deprecated, in favour of using the "as" keyword in a "relates" statement within a relationship. * Bugfix for java.lang.RuntimeException: Couldn’t get PID of Grakn. Received ' (#2815) * get pid using mxbean * Engine should still start if there is a dangling /tmp/grakn-engine.pid file but there's no process anymore.
Why is this PR needed?
Addresses issue #2811
What does the PR do?
ps -ef | grep
withManagementFactory.getRuntimeMXBean().getName()
Does it break backwards compatibility?
No
List of future improvements not on this PR
N/A