You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2022/10/05 11:59:24 UTC

[camel] branch main updated: CAMEL-18582: Prevent build failures due to write lock issues (#8481)

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

nfilotto pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 4d8a9832c8e CAMEL-18582: Prevent build failures due to write lock issues (#8481)
4d8a9832c8e is described below

commit 4d8a9832c8e6666ca89174ff453640dae7e20f8b
Author: Nicolas Filotto <es...@users.noreply.github.com>
AuthorDate: Wed Oct 5 13:59:17 2022 +0200

    CAMEL-18582: Prevent build failures due to write lock issues (#8481)
    
    ## Motivation
    
    Since we upgraded mvnd to 0.8, the locking of the artifacts is now made by default with a file locking (https://github.com/apache/maven-mvnd/pull/508) which causes regular build failures due to write lock issues.
    
    ## Modifications
    
    * Change the named lock factory for a JVM-local implementation based on `ReentrantReadWriteLocks` which is more or less what we had in version 0.7
    * Increase the lock timeout to 5 minutes
    * Generate a thread dump on lock issue
---
 .github/workflows/pr-build.yml | 8 ++++++++
 .mvn/jvm.config                | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml
index d595a0e3b72..86dfd4d6732 100644
--- a/.github/workflows/pr-build.yml
+++ b/.github/workflows/pr-build.yml
@@ -48,6 +48,10 @@ jobs:
         cache: 'maven'
     - name: mvn checkstyle
       run: ${{ steps.install-mvnd.outputs.mvnd-dir }}/mvnd -l checkstyle.log -Dmvnd.threads=2 -V -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 --no-transfer-progress  -Dcheckstyle.failOnViolation=true -e checkstyle:checkstyle
+    - name: Generate a thread dump in case of a lock issue
+      if: failure()
+      run: cat checkstyle.log | grep "Could not acquire write lock for '.*.resolverlock'" > /dev/null && jstack $(jcmd | grep MavenDaemon | awk '{print $1;}') >> checkstyle.log
+      shell: bash
     - name: archive logs
       uses: actions/upload-artifact@v3
       if: always()
@@ -77,6 +81,10 @@ jobs:
           cache: 'maven'
       - name: maven build
         run: ${{ steps.install-mvnd.outputs.mvnd-dir }}/mvnd -l build.log -Dmvnd.threads=2 -V -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 --no-transfer-progress -e -Pfastinstall -DskipTests install
+      - name: Generate a thread dump in case of a lock issue
+        if: failure()
+        run: cat build.log | grep "Could not acquire write lock for '.*.resolverlock'" > /dev/null && jstack $(jcmd | grep MavenDaemon | awk '{print $1;}') >> build.log
+        shell: bash
       - name: archive logs
         uses: actions/upload-artifact@v3
         if: always()
diff --git a/.mvn/jvm.config b/.mvn/jvm.config
index 8b88fcd69c5..2adf7ee033c 100644
--- a/.mvn/jvm.config
+++ b/.mvn/jvm.config
@@ -1 +1 @@
--Xmx3584m -Djava.awt.headless=true -XX:+UseG1GC -XX:+UseStringDeduplication 
+-Xmx3584m -Djava.awt.headless=true -XX:+UseG1GC -XX:+UseStringDeduplication -Daether.syncContext.named.factory=rwlock-local -Daether.syncContext.named.time=300