[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mesos-commits
Subject:    [mesos] branch 1.9.x updated: Added a workaround for `javah -d java/jni` race for creating `java/jni
From:       asekretenko () apache ! org
Date:       2020-06-30 19:13:07
Message-ID: 159354438744.19975.9199760121191902141 () gitbox ! apache ! org
[Download RAW message or body]

This is an automated email from the ASF dual-hosted git repository.

asekretenko pushed a commit to branch 1.9.x
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/1.9.x by this push:
     new c4f012f  Added a workaround for `javah -d java/jni` race for creating \
`java/jni`. c4f012f is described below

commit c4f012f4fb82d38894c4a33e05de127f4788db02
Author: Andrei Sekretenko <asekretenko@apache.org>
AuthorDate: Wed May 27 13:04:02 2020 +0200

    Added a workaround for `javah -d java/jni` race for creating `java/jni`.
    
    This is a workaround for the race between concurrent runs of `javah`
    trying to create the same output directory.
    
    Review: https://reviews.apache.org/r/72549
---
 src/Makefile.am | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/Makefile.am b/src/Makefile.am
index 577acfd..11d0924 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2102,6 +2102,14 @@ BUILT_SOURCES += $(nodist_libjava_la_SOURCES)
 #   of the java file. Unlike 'javah', 'javac -h' requires java sources to
 #   generate headers.
 java/jni/%.h: $(MESOS_JAR)
+	# NOTE: javah has a race between concurrent runs trying to create
+	# the same output directory:
+	# http://hg.openjdk.java.net/jdk8/jdk8/langtools/file/1ff9d5118aae/src/share/classes/com/sun/tools/javah/JavahTask.java#l475
 +	# Thus, we have to create the output directory here.
+	#
+	# TODO(asekretenko): Replace `javah` (deprecated as of JDK 9+)
+	# with `javac` when switching to a newer JDK.
+	mkdir -p java/jni
 if HAS_JAVAH
 	$(JAVA_HOME)/bin/javah -d java/jni                              \
 	  -classpath $(MESOS_JAR):@PROTOBUF_JAR@                        \


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic