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
[WFCORE-2080] Instantiating the WildFlyElytronProvider is an expensive operation so only do it once. #2003
Conversation
…e operation so only do it once.
@@ -97,6 +97,8 @@ | |||
*/ | |||
public class SecurityRealmService implements Service<SecurityRealm>, SecurityRealm { | |||
|
|||
private static final Provider ELYTRON_PROVIDER = new WildFlyElytronProvider(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could use a comment as to why it's ok to store a mutable class in a static field. (I looked at how it's used and it's only read after construction so it's ok, but 4 years from now someone else will ask the same question.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about this I can probably get away with moving this into the service lifecycle, the reported problem was it was being created per request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as it is not created in both providers directly it is fine.
I was testing locally by just having
Provider[] providers = new Provider[]{new WildFlyElytronProvider()}
in service code and than returning that in both providers.
…e operation so only do it once during service start-up.
Windows Build 4331 outcome was FAILURE using a merge of 0453d06 Failed tests
|
Full integration - Windows Build 2396 outcome was FAILURE using a merge of 0453d06 Failed tests
|
❗ Commits from this branch are used in numerous other topic branches so please do not cherry-pick or rebase. ❗
https://issues.jboss.org/browse/WFCORE-2080