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

[Bug] The class loads InternalConfigHolder as a cache class and regenerates an object when used #3495

Open
3 tasks done
Xuxiaotuan opened this issue Jan 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Xuxiaotuan
Copy link
Contributor

Xuxiaotuan commented Jan 17, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

Java Version

Java 8

Scala Version

2.12.x

StreamPark Version

dev

Flink Version

flink all version

deploy mode

kubernetes-session

What happened

The class loads InternalConfigHolder as a cache class, and an object is regenerated when used (it should be the same one, otherwise the cache will become invalid, and everything will become the default value)

As follows:

  1. Springboot startup
    image

  2. Springboot startup is completed, and the yaml configuration is refreshed into InternalConfigHolder through EnvInitializer
    image

  3. After springboot is started, click to start k8s sesssion deploy
    image

It can be seen that after passing this classloader, InternalConfigHolder regenerates an object

image

Error Exception

No response

Screenshots

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!(您是否要贡献这个PR?)

Code of Conduct

@Xuxiaotuan Xuxiaotuan added the bug Something isn't working label Jan 17, 2024
@Xuxiaotuan
Copy link
Contributor Author

8f6dc023-7f1b-4684-b6d2-ba67a046c760

Initially springboot service is initialized using java's original classloader

(sun/misc/Launcher$AppClassLoader)

When submitting the k8s flink task, Will use flink

(org/apache/streampark/flink/proxy/ChildFirstClassLoader)

This reinitializes InternalConfigHolder

@Xuxiaotuan
Copy link
Contributor Author

image

I tried to add an output to InternalConfigHolder, printed it once after the initial service, and then submitted it to the flink environment. Will print again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant