Skip to content

[GLUTEN-9149][CORE] Remove Spark-specific code from JniLibLoader & JniWorkspace#9150

Merged
zzcclp merged 10 commits intoapache:mainfrom
bigo-sg:jni
Apr 7, 2025
Merged

[GLUTEN-9149][CORE] Remove Spark-specific code from JniLibLoader & JniWorkspace#9150
zzcclp merged 10 commits intoapache:mainfrom
bigo-sg:jni

Conversation

@shuai-xu
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Make JniWorkspace not depend on spark.

(Fixes: #9149)

How was this patch tested?

This patch was tested by existing unit tests and integration tests.

@github-actions github-actions bot added CORE works for Gluten Core VELOX labels Mar 27, 2025
@github-actions
Copy link
Copy Markdown

#9149

@github-actions
Copy link
Copy Markdown

Run Gluten ClickHouse CI on ARM

@shuai-xu
Copy link
Copy Markdown
Contributor Author

Run Gluten Clickhouse CI on x86

@github-actions
Copy link
Copy Markdown

Run Gluten ClickHouse CI on ARM

1 similar comment
@github-actions
Copy link
Copy Markdown

Run Gluten ClickHouse CI on ARM

@github-actions
Copy link
Copy Markdown

Run Gluten ClickHouse CI on ARM

1 similar comment
@github-actions
Copy link
Copy Markdown

Run Gluten ClickHouse CI on ARM

Copy link
Copy Markdown
Contributor

@zzcclp zzcclp left a comment

Choose a reason for hiding this comment

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

LGTM

@zzcclp zzcclp requested a review from zhztheplayer March 31, 2025 06:58
@github-actions
Copy link
Copy Markdown

Run Gluten ClickHouse CI on ARM

1 similar comment
@github-actions
Copy link
Copy Markdown

Run Gluten ClickHouse CI on ARM

static {
SparkShutdownManagerUtil.addHookForLibUnloading(
() -> {
forceUnloadAll();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It seems the forceUnloadAll is used to fix the coredump in ch backends. Can we remove this now? @taiyang-li @baibaichen

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, it is still needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It seems can not be removed, or will still coredump

@philo-he philo-he changed the title [GLUTEN-9149] [core] make JniWorkspace not depend on spark [GLUTEN-9149][CORE] Remove Spark-specific code from JniLibLoader & JniWorkspace Mar 31, 2025
Copy link
Copy Markdown
Member

@philo-he philo-he left a comment

Choose a reason for hiding this comment

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

Thanks for your work! Two comments.


public static JniWorkspace getDefault() {
public static void initializeDefault(String rootDir) {
synchronized (DEFAULT_INSTANCE_INIT_LOCK) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we still need synchronized? Seems it can only be executed by one thread in initialize context after this refactoring.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In tests, driver and executors are in the same process, so initialize may be call by driver and executor at the same time.

}

public static JniWorkspace getDefault() {
synchronized (DEFAULT_INSTANCE_INIT_LOCK) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove synchronized.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ditto

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@shuai-xu, seems no need to add "synchronized" in getting the instance.

@zzcclp
Copy link
Copy Markdown
Contributor

zzcclp commented Apr 1, 2025

@philo-he @jackylee-ch is it ok to merge this pr ?

}

public static JniWorkspace getDefault() {
synchronized (DEFAULT_INSTANCE_INIT_LOCK) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@shuai-xu, seems no need to add "synchronized" in getting the instance.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2025

Run Gluten ClickHouse CI on ARM

Copy link
Copy Markdown
Member

@philo-he philo-he left a comment

Choose a reason for hiding this comment

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

Looks good! One trivial comment only.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2025

Run Gluten ClickHouse CI on ARM

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2025

Run Gluten ClickHouse CI on ARM

@zzcclp
Copy link
Copy Markdown
Contributor

zzcclp commented Apr 7, 2025

Run Gluten ClickHouse CI

@zzcclp
Copy link
Copy Markdown
Contributor

zzcclp commented Apr 7, 2025

Run Gluten Clickhouse CI on x86

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2025

Run Gluten ClickHouse CI on ARM

@zzcclp zzcclp merged commit 744d854 into apache:main Apr 7, 2025
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLICKHOUSE CORE works for Gluten Core VELOX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make JniWorkspace not depend on spark

6 participants