Question on jmh.lock

Alun Evans alun at badgerous.net
Tue Jan 12 23:20:28 UTC 2016


> On 12 Jan 2016, at 15:06, Alun Evans <alun at badgerous.net> wrote:
> 
>> 
>> On 12 Jan 2016, at 14:51, Aleksey Shipilev <aleksey.shipilev at oracle.com> wrote:
>> 
>> On 01/13/2016 01:33 AM, Aleksey Shipilev wrote:
>>> On 01/13/2016 12:19 AM, Alun Evans wrote:
>>>>> On 12 Jan 2016, at 10:46, Aleksey Shipilev <aleksey.shipilev at oracle.com> wrote:
>>>>> It's unclear if you actually run into the problem with this mechanism?
>>>> 
>>>> Sorry, yes I have, I’m hitting a permissions problem:
>>>> 
>>>> [alun at poweredge ~]$ ll /tmp/jmh.lock
>>>> -rw-rw-r--. 1 misha misha 0 Jan 11 20:26 /tmp/jmh.lock
>>>> [alun at poweredge ~]$ rm /tmp/jmh.lock
>>>> rm: remove write-protected regular empty file `/tmp/jmh.lock'? y
>>>> rm: cannot remove `/tmp/jmh.lock': Operation not permitted
>>>> [alun at poweredge ~]$
>>>> 
>>>> [INFO] -------------------------------------------------------
>>>> [INFO]  T E S T S
>>>> [INFO] -------------------------------------------------------
>>>> [INFO] Running com.xockets.InterfaceBenchmark
>>>> [INFO] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.081 sec <<< FAILURE! - in com.xockets.InterfaceBenchmark
>>>> [INFO] run(com.xockets.InterfaceBenchmark)  Time elapsed: 0.079 sec  <<< ERROR!
>>>> [INFO] org.openjdk.jmh.runner.RunnerException: ERROR: Exception while trying to acquire the JMH lock (/tmp/jmh.lock): /tmp/jmh.lock (Permission denied), exiting. Use -Djmh.ignoreLock=true to forcefully continue.
>>>> [INFO]  at org.openjdk.jmh.runner.Runner.run(Runner.java:209)
>>>> [INFO]  at com.xockets.AbstractBenchmark.run(AbstractBenchmark.java:92)
>>>> [INFO]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> [INFO]  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>> 
>>> I see. That's indeed problematic! The file should indeed be
>>> world-writeable for this to work properly. I'll take a look how to
>>> fix/workaround this.
>> 
>> That seems simple:
>> https://bugs.openjdk.java.net/browse/CODETOOLS-7901577
>> 
>> Can you test? The owner would need to run JMH at least once to set the
>> permissions right, or remove the lock file completely.
> 
> Sure, just following "Building the "Bleeding Edge” JMH”
> 
>  http://openjdk.java.net/projects/code-tools/jmh/
> 

Looks good so far, just getting a colleague to run “on-top” of my file:

[alun at poweredge ximm]$ git diff src/it/benchmark/pom.xml
diff --git a/ximm/src/it/benchmark/pom.xml b/ximm/src/it/benchmark/pom.xml
index 6ff0daa..74ba530 100644
--- a/ximm/src/it/benchmark/pom.xml
+++ b/ximm/src/it/benchmark/pom.xml
@@ -37,7 +37,7 @@
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <javac.target>1.8</javac.target>
-        <jmh.version>1.6.3</jmh.version>
+        <jmh.version>1.12-SNAPSHOT</jmh.version>
     </properties>

[alun at poweredge ximm]$ mvn clean install
<snip>
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:58 min
[INFO] Finished at: 2016-01-12T15:15:09-08:00
[INFO] Final Memory: 36M/401M
[INFO] ------------------------------------------------------------------------
[alun at poweredge ximm]$ ll /tmp/jmh.lock
-rw-rw-rw-. 1 alun alun 0 Jan 12 15:12 /tmp/jmh.lock
[alun at poweredge ximm]$



A.

--
Alun Evans






More information about the jmh-dev mailing list