Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[improve][dependency] Remove jul-to-slf4j #16320

Merged
merged 15 commits into from
Jul 13, 2022

Conversation

tisonkun
Copy link
Member

@tisonkun tisonkun commented Jul 1, 2022

I'm unsure whether I should create a proposal or start a discussion about this removal on dev@.

Motivation

see also https://lists.apache.org/thread/65skwo492w2nfjwhb3d9y51roq13h8bs

PulsarAdminImpl has a static block requires classpath contains exact either of:

  • slf4j-jdk14
  • jul-to-slf4j

It causes an issue that if user depends on neither slf4j-jdk14 nor jul-to-slf4j, PulsarAdminImpl will panic with NoClassDefFoundError. And thus, user should add one of them (basically jul-to-slf4j) even if they don't depend on it effectively.

Modifications

Remove jul-to-slf4j from all modules under Pulsar.

The Pulsar project uses slf4j as the logging facade consistently. If a user want to add a dependency using a different logging framework, they should take care of the packaging strategy themselves.

pulsar-sql has a dependency to slf4j-jdk14 which redirect slf4j to jul. Since this is a unidirectional redirection, it won't cause runtime error, but pulsar-sql will logging with jul framework, which is the same as with previous workaround.

cc @merlimat as the original author of this stuff.
cc @syhily who points me out this issue.
cc @codelipenghui @eolivelli

Verifying this change

  • Make sure that the change passes the CI checks.

This change is already covered by existing tests.

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (yes)

The motivation and affected scope are described above.

Documentation

  • doc-not-needed

So that we can work with JDK17; otherwise, it will fail with "Unsupported class file major version 61".

Signed-off-by: tison <[email protected]>
@@ -558,7 +558,6 @@ BSD 2-Clause License
MIT License
* Java SemVer -- com.github.zafarkhaja-java-semver-0.9.0.jar -- licenses/LICENSE-SemVer.txt
* SLF4J -- licenses/LICENSE-SLF4J.txt
- org.slf4j-jul-to-slf4j-1.7.32.jar
- org.slf4j-slf4j-api-1.7.32.jar
- org.slf4j-jcl-over-slf4j-1.7.32.jar
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to redirect jcl-over-slf4j due to #1740 that it's an internal dependency to commons-logging and we should handle within Pulsar itself.

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jul 1, 2022
@codelipenghui codelipenghui added this to the 2.11.0 milestone Jul 5, 2022
@codelipenghui codelipenghui added release/important-notice The changes which are important should be mentioned in the release note area/dependency Pull requests that update a dependency file type/cleanup Code or doc cleanups e.g. remove the outdated documentation or remove the code no longer in use labels Jul 5, 2022
@tisonkun
Copy link
Member Author

tisonkun commented Jul 6, 2022

@codelipenghui thanks for your review!

@eolivelli @merlimat could you give a look at this patch so that we can have an opportunity to include it in 2.11.0 as previously proposed in the mailing list?

@tisonkun

This comment was marked as outdated.

2 similar comments
@tisonkun

This comment was marked as outdated.

@tisonkun

This comment was marked as outdated.

@tisonkun
Copy link
Member Author

tisonkun commented Jul 8, 2022

Pulsar Bot Command match exactly without whitespace, perhaps we should trim before match comments..

@tisonkun
Copy link
Member Author

tisonkun commented Jul 8, 2022

Pulsar Bot Command match exactly without whitespace, perhaps we should trim before match comments..

FYI apache/pulsar-test-infra#54

@tisonkun
Copy link
Member Author

tisonkun commented Jul 8, 2022

/pulsarbot run-failure-checks

@tisonkun
Copy link
Member Author

tisonkun commented Jul 8, 2022

CPP Tests ever passed at https://github.com/apache/pulsar/runs/7192710852?check_suite_focus=true, all later commits are merge commit.

Broker Tests Group 1 ever passed at https://github.com/apache/pulsar/runs/7153335951?check_suite_focus=true, all later commits are merge commit.

@tisonkun

This comment was marked as duplicate.

1 similar comment
@tisonkun

This comment was marked as duplicate.

@tisonkun

This comment was marked as duplicate.

@tisonkun
Copy link
Member Author

tisonkun commented Jul 8, 2022

It seems Broker Group 1 suite often timeout.

@tisonkun
Copy link
Member Author

tisonkun commented Jul 8, 2022

/pulsarbot run-failure-checks

@syhily
Copy link

syhily commented Jul 8, 2022

Cool. I have been waiting for this for a loooooong time.

@tisonkun
Copy link
Member Author

tisonkun commented Jul 8, 2022

Merge master tomorrow to retry running tests. Stop continue rerunning failure tests >_<

@tisonkun
Copy link
Member Author

tisonkun commented Jul 9, 2022

OWASP failed on false positive cases, see also jetty/jetty.project#8161 (comment). I think it should be resolve on upstream soon later.

@tisonkun
Copy link
Member Author

tisonkun commented Jul 9, 2022

/pulsarbot run-failure-checks

@tisonkun
Copy link
Member Author

tisonkun commented Jul 9, 2022

/pulsarbot run-failure-checks

1 similar comment
@tisonkun
Copy link
Member Author

tisonkun commented Jul 9, 2022

/pulsarbot run-failure-checks

@tisonkun
Copy link
Member Author

/pulsarbot run-failure-checks

@tisonkun
Copy link
Member Author

tisonkun commented Jul 10, 2022

"CI - Unit - Brokers - Broker Group 1" failed over days and the failures seem quick weird; for example, package-info.java not found but it's exactly there.

@codelipenghui @eolivelli it seems this patch block by those flaky tests. Could you help to confirm and if it's the case, advice how to make progress?

@tisonkun
Copy link
Member Author

/pulsarbot run-failure-checks

1 similar comment
@tisonkun
Copy link
Member Author

/pulsarbot run-failure-checks

@tisonkun
Copy link
Member Author

/pulsarbot run-failure-checks

1 similar comment
@tisonkun
Copy link
Member Author

/pulsarbot run-failure-checks

@tisonkun
Copy link
Member Author

@codelipenghui @eolivelli all required CI tasks passed. Could you please help on moving forward this patch?

cc @merlimat

@codelipenghui codelipenghui merged commit 303038a into apache:master Jul 13, 2022
wuxuanqicn pushed a commit to wuxuanqicn/pulsar that referenced this pull request Jul 14, 2022
### Motivation

see also https://lists.apache.org/thread/65skwo492w2nfjwhb3d9y51roq13h8bs

PulsarAdminImpl has a static block requires classpath contains exact either of:

* slf4j-jdk14
* jul-to-slf4j

It causes an issue that if user depends on neither slf4j-jdk14 nor jul-to-slf4j, PulsarAdminImpl will panic with NoClassDefFoundError. And thus, user should add one of them (basically jul-to-slf4j) even if they don't depend on it effectively.

### Modifications

Remove jul-to-slf4j from all modules under Pulsar.

The Pulsar project uses slf4j as the logging facade consistently. If a user want to add a dependency using a different logging framework, they should take care of the packaging strategy themselves.

pulsar-sql has a dependency to slf4j-jdk14 which redirect slf4j to jul. Since this is a unidirectional redirection, it won't cause runtime error, but pulsar-sql will logging with jul framework, which is the same as with previous workaround.
@tisonkun tisonkun deleted the remove-jul-to-slf4j branch July 27, 2022 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dependency Pull requests that update a dependency file doc-not-needed Your PR changes do not impact docs release/important-notice The changes which are important should be mentioned in the release note type/cleanup Code or doc cleanups e.g. remove the outdated documentation or remove the code no longer in use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants