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

Fixes recycler factory provider initialization #2583

Merged
merged 3 commits into from
May 21, 2024
Merged

Conversation

vy
Copy link
Member

@vy vy commented May 15, 2024

Discovered while porting #2533 to main.

@vy vy added the bug Incorrect, unexpected, or unintended behavior of existing code label May 15, 2024
@vy vy added this to the 3.x milestone May 15, 2024
@vy vy requested a review from ppkarwasz May 15, 2024 14:09
@vy vy self-assigned this May 15, 2024
@ppkarwasz
Copy link
Contributor

I think that the RecyclerFactoryProvider.createForEnvironment method should never return null.

If we want to deal with the specific case of ThreadLocalRecyclerFactoryProvider that should be disabled by default if log4j2.enableThreadlocals is set to false, we can play with its order:

@Override
public int getOrder() {
return SERVLET_API_PRESENT ? Integer.MAX_VALUE : 700;
}

If the order is high enough, the dummy provider will prevail unless the user explicitly requested threadLocal to be used.

@vy
Copy link
Member Author

vy commented May 21, 2024

I think that the RecyclerFactoryProvider.createForEnvironment method should never return null.

Right. Fixed in b741632.

@vy vy merged commit cfedc22 into main May 21, 2024
2 of 6 checks passed
@vy vy deleted the fix/main/recycler-factory-init branch May 21, 2024 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect, unexpected, or unintended behavior of existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants