lll-peanut opened a new issue, #6459:
URL: https://github.com/apache/shenyu/issues/6459

   ### Is there an existing issue for this?
   
   - [x] I have searched the existing issues
   
   ### Current Behavior
   
    CI builds intermittently fail with `maven-remote-resources-plugin:1.5` 
reporting
     "Could not acquire lock(s)" when multiple modules execute 
`process-resource-bundles`
     in parallel via `mvnd`.
   
     Example from a recent `master` push:
     [ERROR] Failed to execute goal maven-remote-resources-plugin:1.5:process
     (process-resource-bundles) on project shenyu-plugin-logging-rocketmq:
     Could not acquire lock(s)
     [ERROR] shenyu-plugin-logging-huawei-lts: Could not acquire lock(s)
     [ERROR] shenyu-plugin-logging-pulsar: Could not acquire lock(s)
   
     The affected modules are random — sometimes logging modules, sometimes
     `client-core` / `sync-data-polaris` / `sync-data-websocket`. The same code 
can
     pass 38/38 PR checks then fail on merge to master due to different thread
     scheduling order.
   
   
   
   ### Expected Behavior
   
   CI `clean test` builds should complete reliably regardless of mvnd thread 
scheduling.
     The `maven-remote-resources-plugin` is only needed for packaging 
LICENSE/NOTICE
     into JARs — skipping it during `clean test` should have no functional 
impact.
   
   
   ### Steps To Reproduce
   
    1. Push any commit that triggers the CI workflow 
(`.github/workflows/ci.yml`)
     2. The `mvnd -B clean test -Prelease` command builds all modules in 
parallel
     3. Multiple modules simultaneously hit the `process-resource-bundles` 
phase,
        competing for the same file lock on the `apache-jar-resource-bundle` 
cache
     4. Some module(s) fail with "Could not acquire lock(s)"
   
     The issue is intermittent — it may take several CI runs to reproduce 
because it
     depends on exact thread timing.
   
   
   ### Environment
   
   ```markdown
   - ShenYu version: 2.7.2-SNAPSHOT (master branch)
     - Maven: mvnd 1.0.2 / mvnw 3.6.3
     - Parent POM: org.apache:apache:21
     - Plugin: maven-remote-resources-plugin:1.5
     - Resource bundle: apache-jar-resource-bundle:1.4
     - CI: GitHub Actions, ubuntu-latest, JDK 17
   ```
   
   ### Debug logs
   
   
   
   
   ### Anything else?
   
    ### Root cause
     The Apache parent POM `org.apache:apache:21` binds
     `maven-remote-resources-plugin:process` to the `process-resource-bundles` 
phase
     for every module. This plugin uses file-based locking on a shared cache 
directory
     in `~/.m2/repository`, which doesn't handle concurrent access from 
parallel mvnd
     builds. Version 1.5 of the plugin has a known issue with this locking 
mechanism.
   
     ### Proposed fix
     1. Add `<skipRemoteResources>` property (default `false`) in root `pom.xml`
     2. Configure the plugin with `<skip>${skipRemoteResources}</skip>`, 
documenting
        the skip capability in the project POM
     3. Pass `-DskipRemoteResources=true` in CI's `clean test` phase only
   
     The plugin injects LICENSE/NOTICE files into META-INF during `package` 
phase
     only — not needed for `clean test`. Release packaging is unaffected since 
the
     property defaults to `false`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to