Skip to content

[GLUTEN-5741][CH] Fix core dump when executor exits - #5787

Merged
baibaichen merged 1 commit into
apache:mainfrom
exmy:fix-core
May 20, 2024
Merged

baibaichen merged 1 commit into
apache:mainfrom
exmy:fix-core

Conversation

@exmy

@exmy exmy commented May 17, 2024 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

(Fixes: #5741 #5744)

https://github.com/apache/incubator-gluten/blob/10182a52d409cb659169cbfe1d7f1869d9205dce/gluten-core/src/main/java/org/apache/gluten/vectorized/JniLibLoader.java#L131

When running on yarn cluster, libPath is a symbolic link existed on the working directory of yarn container, like /data5/hadoop/yarn/local/usercache/xumingyong/appcache/application_1710462985812_777680/container_e57_1710462985812_777680_01_000321/./libch.so. It's an APPLICATION level resource and will be removed when container exits. So it may have been removed here when reading real path, which causes Files.isSymbolicLink(Paths.get(libPath)) return false in that the library (e.g. libch.so) cannot be unload and the method JNI_OnUnload cannot be invoked (which casuses core dump). As a workaround, we can read real path when loading the library.

How was this patch tested?

manual tests

@github-actions

Copy link
Copy Markdown

#5741

@github-actions

Copy link
Copy Markdown

Run Gluten Clickhouse CI

Comment thread gluten-core/src/main/java/org/apache/gluten/vectorized/JniLibLoader.java Outdated
@exmy

exmy commented May 17, 2024

Copy link
Copy Markdown
Contributor Author

@baibaichen @zhztheplayer Could you help review this change? Thanks!

@github-actions

Copy link
Copy Markdown

Run Gluten Clickhouse CI

@baibaichen baibaichen left a comment

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.

LGTM.

@baibaichen

Copy link
Copy Markdown
Contributor

@exmy please update comment and merge it.

@exmy

exmy commented May 20, 2024

Copy link
Copy Markdown
Contributor Author

@exmy please update comment and merge it.

done

@baibaichen
baibaichen merged commit 73e11a3 into apache:main May 20, 2024
@GlutenPerfBot

Copy link
Copy Markdown
Contributor

===== Performance report for TPCH SF2000 with Velox backend, for reference only ====

query log/native_5787_time.csv log/native_master_05_13_2024_33f993554_time.csv difference percentage
q1 34.21 36.42 2.214 106.47%
q2 23.54 23.70 0.155 100.66%
q3 36.07 36.61 0.545 101.51%
q4 38.17 37.83 -0.341 99.11%
q5 68.97 70.62 1.644 102.38%
q6 7.01 7.47 0.461 106.58%
q7 81.66 85.08 3.411 104.18%
q8 83.79 84.30 0.511 100.61%
q9 117.86 121.00 3.141 102.66%
q10 45.79 45.37 -0.423 99.08%
q11 20.76 19.49 -1.270 93.88%
q12 26.35 26.52 0.167 100.63%
q13 53.81 55.08 1.270 102.36%
q14 21.39 21.53 0.144 100.67%
q15 30.87 29.02 -1.848 94.01%
q16 13.90 14.00 0.100 100.72%
q17 101.14 103.62 2.482 102.45%
q18 145.13 146.24 1.110 100.76%
q19 16.38 13.35 -3.032 81.49%
q20 28.53 29.06 0.532 101.86%
q21 286.77 282.54 -4.229 98.53%
q22 18.52 14.61 -3.906 78.91%
total 1300.61 1303.44 2.837 100.22%

liuneng1994 pushed a commit that referenced this pull request Jun 6, 2024
… in executors are killed or interrupted (#5839)

What changes were proposed in this pull request?
Changes:

Clean code: remove useless JNIs and classes under cpp-ch
Support cancel for all gluten processors. It was triggered when task is killed or shut down.
Make sure offheap memory free does not throw exception. Ref: https://zhuanlan.zhihu.com/p/65454580
(Fixes: #5787 #5823)

How was this patch tested?
Manual
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

Successfully merging this pull request may close these issues.

[CH] Crash on gluten exit

3 participants