IMPALA-7051: Serialize Maven invocations. I've observed some rare cases where Impala fails to build. I believe it's because two Maven targets (yarn-extras and ext-data-source) are being executed simultaneously. Maven's handling of ~/.m2/repository, for example, is known to be not safe.
This patch serializes the Maven builds with the following dependency graph: fe -> yarn-extras -> ext-data-source -> impala-parent The ordering of yarn-extras -> ext-data-source is arbitrary. I decided that this artificial dependency was the clearest way to prevent parallel executions. Having mvn-quiet.sh take a lock seemed considerably more complex. Change-Id: Ie24f34f421bc7dcf9140938464d43400da95275e Reviewed-on: http://gerrit.cloudera.org:8080/10460 Reviewed-by: Tim Armstrong <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/impala/repo Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/98052e07 Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/98052e07 Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/98052e07 Branch: refs/heads/2.x Commit: 98052e078a77f86a21a55aec234a269fd2a0c19e Parents: 3b8a964 Author: Philip Zeyliger <[email protected]> Authored: Fri May 18 16:36:58 2018 -0700 Committer: Impala Public Jenkins <[email protected]> Committed: Fri May 25 23:17:16 2018 +0000 ---------------------------------------------------------------------- common/yarn-extras/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/impala/blob/98052e07/common/yarn-extras/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/common/yarn-extras/CMakeLists.txt b/common/yarn-extras/CMakeLists.txt index 2b5f005..4f46ba5 100644 --- a/common/yarn-extras/CMakeLists.txt +++ b/common/yarn-extras/CMakeLists.txt @@ -15,6 +15,9 @@ # specific language governing permissions and limitations # under the License. -add_custom_target(yarn-extras ALL DEPENDS impala-parent +# The dependency on ext-data-source here is fictional, but Maven does not like +# concurrent invocations. These lead to opaque, non-deterministic errors due to +# races in how Maven handles its ~/.m2/repository doc. +add_custom_target(yarn-extras ALL DEPENDS impala-parent ext-data-source COMMAND $ENV{IMPALA_HOME}/bin/mvn-quiet.sh -B install -DskipTests )
