[ 
https://issues.apache.org/jira/browse/LUCENE-4510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13526356#comment-13526356
 ] 

Uwe Schindler commented on LUCENE-4510:
---------------------------------------

Here is it:
{quote}
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 it returns a value like 12345@localhost (12345 being the process id). 
Beware though that according to the docs, there are no guarantees about this 
value:

Returns the name representing the running Java virtual machine. The returned 
name string can be any arbitrary string and a Java virtual machine 
implementation can choose to embed platform-specific useful information in the 
returned name string. Each running virtual machine could have a different name.
{quote}
(from 
http://stackoverflow.com/questions/35842/how-can-a-java-program-get-its-own-process-id)
                
> when a test's heart beats it should also throw up (dump stack of all threads)
> -----------------------------------------------------------------------------
>
>                 Key: LUCENE-4510
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4510
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Michael McCandless
>            Assignee: Dawid Weiss
>
> We've had numerous cases where tests were hung but the "operator" of that 
> particular Jenkins instance struggles to properly get a stack dump for all 
> threads and eg accidentally kills the process instead (rather awful that the 
> same powerful tool "kill" can be used to get stack traces and to destroy the 
> process...).
> Is there some way the test infra could do this for us, eg when it prints the 
> HEARTBEAT message?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to