[ 
https://issues.apache.org/jira/browse/HADOOP-20049?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18135791#comment-18135791
 ] 

ASF GitHub Bot commented on HADOOP-20049:
-----------------------------------------

joseluisll opened a new pull request, #8903:
URL: https://github.com/apache/hadoop/pull/8903

   ### Description of PR
   
   Part of HADOOP-19912 (Jetty 12 on ee8). This must land before HADOOP-19972 
(#8704) or together with it.
   
   Jetty 12.1.14 declares `org.slf4j:slf4j-api:2.0.17` at compile scope; in 
Jetty 9.4 it is provided and optional. Jetty itself runs correctly on Hadoop's 
1.7.36, because it uses no slf4j 2-only API, but the declaration reaches Maven 
consumers of the non-shaded artifacts.
   
   `hadoop-hdfs`, `hadoop-hdfs-nfs` and `hadoop-yarn-client` depend on Jetty 
directly, do not declare `slf4j-api`, and keep `hadoop-common` at `provided`. 
On Jetty 12, a consumer declaring one of them before `hadoop-client` resolves 
`slf4j-api:2.0.17` with `slf4j-reload4j:1.7.36`. slf4j 2 ignores that binding, 
so all logging goes to NOP, with only a warning on stderr. Shaded clients are 
not affected.
   
   This patch declares `slf4j-api` in those three modules, so it stays at the 
managed version. Hadoop stays on slf4j 1.7.36.
   
   Impact on Jetty 9.4: `hadoop-hdfs` and `hadoop-hdfs-nfs`, as a consumer's 
only Hadoop dependency, now bring `slf4j-api` 1.7.36, where they brought none. 
No other change.
   
   ### How was this patch tested?
   
   - On this branch, on Jetty 9.4: the three modules and what they depend on 
compile, and each resolves `slf4j-api` 1.7.36. No unit tests were run: this is 
a dependency declaration only.
   - Against the Jetty 12 artifacts of #8704, with these declarations applied 
to copies of the published poms, not rebuilt from source. Sample consumers, 
with default Maven mediation:
   
   | Each of the 89 published jar artifacts, then `hadoop-client` | Without | 
With |
   |---|---|---|
   | Artifacts resolving `slf4j-api` 2.0.17 | 3 | 0 |
   | `hadoop-hdfs`, then `hadoop-client` | NOP, 0 log lines | Reload4j, Jetty 
and access logs present |
   | `hadoop-hdfs-nfs`, then `hadoop-client` | NOP, 0 log lines | Reload4j, 
Jetty and access logs present |
   | `hadoop-yarn-client`, then `hadoop-client` | NOP | Reload4j |
   
   Other dependency orderings and real downstream projects were not tested. The 
Jetty 12 checks should be repeated when #8704 is rebuilt on this change.
   
   ### For code changes:
   
   - [x] Does the title of this PR start with the corresponding JIRA issue id 
(e.g. 'HADOOP-17799. Your PR title ...')?
   - [ ] Object storage: Have the integration tests been executed and the 
endpoint declared according to the connector-specific documentation? (not 
applicable)
   - [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)? (not applicable: 
`slf4j-api` is already a dependency)
   - [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, 
`NOTICE-binary` files? (not applicable)
   
   ### AI Tooling
   
   If an AI tool was used:
   
   - [x] The PR includes the phrase "Contains content generated by Claude" 
where Claude is the name of the AI tool used.
   - [x] My use of AI contributions follows the ASF legal policy 
https://www.apache.org/legal/generative-tooling.html
   
   Contains content generated by Claude.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   




> Keep slf4j-api at the managed version for consumers once Jetty 12 is in
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-20049
>                 URL: https://issues.apache.org/jira/browse/HADOOP-20049
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: build, common
>            Reporter: Jose Luis López
>            Assignee: Jose Luis López
>            Priority: Major
>
> Jetty 12.1.14 declares {{org.slf4j:slf4j-api:2.0.17}} at compile scope; in 
> Jetty 9.4 it is provided and optional. It runs correctly on Hadoop's 1.7.36, 
> but the declaration reaches Maven consumers of the non-shaded artifacts. 
> {{hadoop-yarn-client}}, {{hadoop-hdfs}} and {{hadoop-hdfs-nfs}} depend on 
> Jetty directly, do not declare {{slf4j-api}}, and keep {{hadoop-common}} at 
> provided. A consumer declaring one of them before {{hadoop-client}} then 
> resolves {{slf4j-api:2.0.17}} with {{slf4j-reload4j:1.7.36}}. slf4j 2 ignores 
> that binding, so all logging goes to NOP, with only a warning on stderr. 
> Shaded clients are not affected.
> This must land before HADOOP-19972 or together with it. Hadoop stays on slf4j 
> 1.7.36. Moving to slf4j 2 is out of scope.
> *Verification:* with the fix, no published artifact resolves {{slf4j-api}} 
> 2.0.17 through Jetty, alone or declared before {{hadoop-client}}.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

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

Reply via email to