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

Child only resource discovery #145

Merged
merged 1 commit into from
Nov 8, 2022

Conversation

honnix
Copy link
Member

@honnix honnix commented Nov 4, 2022

TL;DR

Configure child only resource discovery to avoid discovering certain resources across class loaders.

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

For certain resources such as org/slf4j/impl/StaticLoggerBinder.class, it does not make sense to discovery a parent one because it will almost certain cause classloading problem when mixing parent class and child class.

Tracking Issue

Closes flyteorg/flyte#3051

Follow-up issue

NA

@welcome
Copy link

welcome bot commented Nov 4, 2022

Thank you for opening this pull request! 🙌
These tips will help get your PR across the finish line: - Most of the repos have a PR template; if not, fill it out to the best of your knowledge. - Sign off your commits (Reference: DCO Guide).

@@ -42,6 +45,9 @@ class ChildFirstClassLoader extends URLClassLoader {
private static final String[] PARENT_FIRST_PACKAGE_PREFIXES =
new String[] {"org.flyte.api.v1.", "org.flyte.jflyte.api."};

private static final Set<String> CHILD_ONLY_RESOURCES =
Copy link
Member Author

Choose a reason for hiding this comment

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

This project is still targeting Java 8, so no factory method from Set to use.

@honnix honnix force-pushed the skip-parent-slf4j-resource branch 6 times, most recently from 8bbc509 to c044752 Compare November 5, 2022 09:00
@honnix honnix requested review from narape and RRap0so and removed request for narape November 7, 2022 09:30
@honnix honnix force-pushed the skip-parent-slf4j-resource branch 4 times, most recently from 01e38ef to 66bafbd Compare November 7, 2022 21:09
Signed-off-by: Hongxin Liang <honnix@users.noreply.github.com>
@honnix honnix force-pushed the skip-parent-slf4j-resource branch from 66bafbd to bfdf6f6 Compare November 7, 2022 21:11
@honnix
Copy link
Member Author

honnix commented Nov 8, 2022

I don't have permission to merge. Maybe I should be added to some team?

@RRap0so RRap0so merged commit 078a07f into flyteorg:master Nov 8, 2022
@welcome
Copy link

welcome bot commented Nov 8, 2022

Congrats on merging your first pull request! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] flytekit-java tries to discover slf4j implementation through parent class loader
2 participants