joseluisll commented on PR #8894:
URL: https://github.com/apache/hadoop/pull/8894#issuecomment-7087115944

   
   Good catch — the three direct declarations should not be there at all. They
   turned out to be redundant: the router's main code only uses `WebAppContext`
   from `jetty-webapp` (it serves the UI2 war), and `jetty-webapp` 9.4.58 
already
   brings the whole servlet stack transitively at compile scope
   (`jetty-servlet` -> `jetty-security` -> `jetty-server` -> 
`jetty-http`/`jetty-io`
   -> `jetty-util`), so the router needs none of them directly — and it compiled
   with no Jetty declarations at all before this PR — while `Server`,
   `ServerConnector`, `FilterHolder`/`ServletHolder`/`ServletContextHandler`/
   `ServletHandler` and `QueuedThreadPool` are only imported from 
`src/test/java`.
   I've pushed a fix removing the `jetty-server`, `jetty-servlet` and 
`jetty-util`
   declarations from the router pom; only `jetty-webapp` stays, at compile 
scope.
   The branch was regenerated as a single commit on the current trunk
   (head `90e500745454`).
   
   Here is the before/after `dependency:tree` of a downstream consumer of
   `hadoop-yarn-server-router` (a consumer pom whose only dependency is the
   router), filtered to `org.eclipse.jetty`:
   
   Before (trunk — everything arrives through `hadoop-common`):
   
   ```
   \- org.apache.hadoop:hadoop-yarn-server-router:jar:3.6.0-SNAPSHOT:compile
      +- org.apache.hadoop:hadoop-common:jar:3.6.0-SNAPSHOT:compile
      |  +- org.eclipse.jetty:jetty-server:jar:9.4.58.v20250814:compile
      |  |  +- org.eclipse.jetty:jetty-http:jar:9.4.58.v20250814:compile
      |  |  \- org.eclipse.jetty:jetty-io:jar:9.4.58.v20250814:compile
      |  +- org.eclipse.jetty:jetty-util:jar:9.4.58.v20250814:compile
      |  +- org.eclipse.jetty:jetty-servlet:jar:9.4.58.v20250814:compile
      |  |  +- org.eclipse.jetty:jetty-security:jar:9.4.58.v20250814:compile
      |  |  \- org.eclipse.jetty:jetty-util-ajax:jar:9.4.58.v20250814:compile
      |  \- org.eclipse.jetty:jetty-webapp:jar:9.4.58.v20250814:compile
      |     \- org.eclipse.jetty:jetty-xml:jar:9.4.58.v20250814:compile
      ...
   ```
   
   After the fix (no new direct Jetty edges off the router except 
`jetty-webapp`,
   which moves from a depth-3 path through `hadoop-common` to a direct depth-2
   edge, same artifact and version; `jetty-server`/`jetty-servlet`/`jetty-util`
   resolve as before, through `hadoop-common` and through `jetty-webapp`'s own
   transitive chain):
   
   ```
   \- org.apache.hadoop:hadoop-yarn-server-router:jar:3.6.0-SNAPSHOT:compile
      +- org.apache.hadoop:hadoop-common:jar:3.6.0-SNAPSHOT:compile
      |  +- org.eclipse.jetty:jetty-server:jar:9.4.58.v20250814:compile
      |  |  +- org.eclipse.jetty:jetty-http:jar:9.4.58.v20250814:compile
      |  |  \- org.eclipse.jetty:jetty-io:jar:9.4.58.v20250814:compile
      |  +- org.eclipse.jetty:jetty-util:jar:9.4.58.v20250814:compile
      |  \- org.eclipse.jetty:jetty-servlet:jar:9.4.58.v20250814:compile
      |     +- org.eclipse.jetty:jetty-security:jar:9.4.58.v20250814:compile
      |     \- org.eclipse.jetty:jetty-util-ajax:jar:9.4.58.v20250814:compile
      \- org.eclipse.jetty:jetty-webapp:jar:9.4.58.v20250814:compile
         \- org.eclipse.jetty:jetty-xml:jar:9.4.58.v20250814:compile
   ```
   
   For reference, what you would have seen with the compile scopes as originally
   pushed (all four hanging directly off the router, so `jetty-server`,
   `jetty-servlet` and `jetty-util` would become direct compile-scope edges in
   every downstream consumer's graph):
   
   ```
   \- org.apache.hadoop:hadoop-yarn-server-router:jar:3.6.0-SNAPSHOT:compile
      +- org.eclipse.jetty:jetty-webapp:jar:9.4.58.v20250814:compile
      +- org.eclipse.jetty:jetty-server:jar:9.4.58.v20250814:compile
      +- org.eclipse.jetty:jetty-servlet:jar:9.4.58.v20250814:compile
      \- org.eclipse.jetty:jetty-util:jar:9.4.58.v20250814:compile
   ```
   
   In this particular case the versions could not actually drift — the PR does
   not change `jetty.version` (9.4.58.v20250814 on both sides), and all Jetty
   artifacts are managed at `${jetty.version}` in `hadoop-project`'s
   dependencyManagement — but with compile scope the three direct edges would
   still have become nearest-wins competitors against a downstream consumer's 
own
   independently versioned Jetty dependencies. Removing the declarations 
restores
   the trunk-shaped graph, and the router's main compilation and tests are
   unchanged (verified with a clean rebuild plus TestRouterServerUtil and
   TestRouterAuditLogger).
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to