davsclaus opened a new pull request, #29781:
URL: https://github.com/apache/camel/pull/29781

   JIRA: [CAMEL-26901](https://issues.apache.org/jira/browse/CAMEL-26901) 
(finding 5).
   
   **Stacked on #29778** (camel run: one version of each library), which is 
stacked on #29777 (leave out what is already on the classpath). Review only the 
last commit. The three PRs change the imports of `MavenDownloaderImpl` at the 
same spot, hence the stack. It merges with #29774 (fail fast on declared 
dependencies) without conflict in the code; the only conflict is the end of the 
4.24 upgrade guide, which #29774 and #29778 both append to.
   
   ### A repository that stops sending fails after 60 seconds
   
   Maven Resolver waits 30 minutes for data from a repository 
(`aether.connector.requestTimeout`, the socket read timeout). A mirror that 
accepts the connection and then stalls kept `camel run` waiting that long, 
printing `Downloading: ... (elapsed: ...)` every 5 seconds. The Camel default 
is now 60 seconds. The resolver session already takes the JVM system 
properties, so `-Daether.connector.requestTimeout=...` (for example in 
`JAVA_TOOL_OPTIONS`) still wins. Only the standalone (MIMA) mode is affected; 
the Maven plugins (embedded mode) use the session of Maven.
   
   ### A repository that cannot be connected to is not asked again
   
   Each POM and JAR that is not in the local repository was asked of every 
repository. An unreachable one (a VPN that is off, a typo in `--repos`, a 
mirror that is down) cost the connect timeout (10 seconds) for each of them. A 
transfer listener now notes the repositories with a connect failure: unknown 
host, connection refused, or connect timeout, but not a read timeout. They are 
left out of the next resolutions, with one WARN:
   
   ```
   Cannot connect to Maven repository: http://10.255.255.1/maven2 due to: 
Connect to 10.255.255.1:80 [/10.255.255.1] failed: Connect timed out. The 
repository is not used anymore.
   ```
   
   A resolution failure lists them: `Cannot resolve dependencies in 
https://repo1.maven.org/maven2, http://10.255.255.1/maven2 (not reachable)`.
   
   `camel run` with two dependencies that do not exist and an unreachable 
repository in `--repos`: 23s instead of 44s. The first resolution still pays 
the connect timeout twice (POM and JAR), because the resolver keeps the 
repository list of the request it is running.
   
   ### Tests
   
   - `MavenDownloaderImplTest`:
     - A repository that refuses connections is noted, left out of the next 
resolution, and listed as not reachable; the other repository is still used.
     - A repository that accepts the connection and never answers fails on the 
request timeout, and is not noted as unreachable.
     - Which exceptions count as connect failures.
   - camel-tooling-maven: all tests pass. By hand, with the launcher patched 
with the JARs of this stack: the run above, and a normal run.
   
   Docs: the timeouts and the system properties in "Downloading JARs over the 
internet" of the Camel CLI running page, and a 4.24 upgrade guide entry for the 
changed default.
   
   _Claude Code on behalf of Claus Ibsen (davsclaus)_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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