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

InitExecutor may repeat "doInit" #3

Closed
xuyue531 opened this issue Jul 24, 2018 · 2 comments
Closed

InitExecutor may repeat "doInit" #3

xuyue531 opened this issue Jul 24, 2018 · 2 comments

Comments

@xuyue531
Copy link

xuyue531 commented Jul 24, 2018

InitExecutor#doInit() may be executed repeatedly.

we can do this to avoid repeat doInit.

private static AtomicBoolean initialized = new AtomicBoolean(false);
...
public static void doInit() {
  if (!initialized.compareAndSet(false, true)) {
       return;
  }
  ...
}
@sczyh30
Copy link
Member

sczyh30 commented Jul 24, 2018

Thanks for reporting!

@CodeIngL
Copy link

it only happen in staic { }. is it a NotThreadSafe ? It is ThreadSafe

linlinisme added a commit that referenced this issue Mar 5, 2020
CST11021 pushed a commit to CST11021/Sentinel that referenced this issue Nov 3, 2021
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

No branches or pull requests

3 participants