-
Notifications
You must be signed in to change notification settings - Fork 359
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
[CELEBORN-1544] ShuffleWriter needs to call close finally to avoid memory leaks #2661
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SteNicholas
approved these changes
Aug 2, 2024
waitinfuture
approved these changes
Aug 2, 2024
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.
LGTM, thanks! Merging to main(v0.6.0), branch-0.5(v0.5.2)
waitinfuture
pushed a commit
that referenced
this pull request
Aug 2, 2024
…mory leaks ### What changes were proposed in this pull request? This PR aims to fix a possible memory leak in ShuffleWriter. ### Why are the changes needed? When we turn on `spark.speculation=true` or we kill the executing SQL, the task may be interrupted. At this time, `ShuffleWriter` may not call close. At this time, `DataPusher#idleQueue` will occupy some memory capacity ( `celeborn.client.push.buffer.max.size` * `celeborn.client.push.queue.capacity` ) and the instance will not be released. ```java Thread 537 (DataPusher-78931): State: TIMED_WAITING Blocked count: 0 Waited count: 16337 IsDaemon: true Stack: java.lang.Thread.sleep(Native Method) org.apache.celeborn.client.write.DataPushQueue.takePushTasks(DataPushQueue.java:135) org.apache.celeborn.client.write.DataPusher$1.run(DataPusher.java:122) ``` ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Production testing #### Current <img width="547" alt="image" src="https://github.com/user-attachments/assets/d6f64257-144e-4139-96c6-518ca5f1bfd2"> #### PR <img width="479" alt="image" src="https://github.com/user-attachments/assets/e4ff62ec-5b9d-47a4-a36c-1d13bf378cbc"> Closes #2661 from cxzl25/CELEBORN-1544. Authored-by: sychen <[email protected]> Signed-off-by: zky.zhoukeyong <[email protected]> (cherry picked from commit 48ce9b9) Signed-off-by: zky.zhoukeyong <[email protected]>
waitinfuture
pushed a commit
that referenced
this pull request
Aug 21, 2024
…call abort to avoid memory leaks ### What changes were proposed in this pull request? This PR aims to fix a possible memory leak in ShuffleWriter. Introduce a private abort method, which can be called to release memory when an exception occurs. ### Why are the changes needed? #2661 Call the close method in the finally block, but the close method has `shuffleClient.mapperEnd`, which is dangerous for incomplete tasks, and the data may be inaccurate. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? GA Closes #2663 from cxzl25/CELEBORN-1544-followup. Authored-by: sychen <[email protected]> Signed-off-by: zky.zhoukeyong <[email protected]>
waitinfuture
pushed a commit
that referenced
this pull request
Aug 21, 2024
…call abort to avoid memory leaks ### What changes were proposed in this pull request? This PR aims to fix a possible memory leak in ShuffleWriter. Introduce a private abort method, which can be called to release memory when an exception occurs. ### Why are the changes needed? #2661 Call the close method in the finally block, but the close method has `shuffleClient.mapperEnd`, which is dangerous for incomplete tasks, and the data may be inaccurate. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? GA Closes #2663 from cxzl25/CELEBORN-1544-followup. Authored-by: sychen <[email protected]> Signed-off-by: zky.zhoukeyong <[email protected]> (cherry picked from commit bc3bd46) Signed-off-by: zky.zhoukeyong <[email protected]>
gotikkoxq
added a commit
to gotikkoxq/celeborn
that referenced
this pull request
Aug 26, 2024
…call abort to avoid memory leaks ### What changes were proposed in this pull request? This PR aims to fix a possible memory leak in ShuffleWriter. Introduce a private abort method, which can be called to release memory when an exception occurs. ### Why are the changes needed? apache/celeborn#2661 Call the close method in the finally block, but the close method has `shuffleClient.mapperEnd`, which is dangerous for incomplete tasks, and the data may be inaccurate. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? GA Closes #2663 from cxzl25/CELEBORN-1544-followup. Authored-by: sychen <[email protected]> Signed-off-by: zky.zhoukeyong <[email protected]>
Since this is a bug fix, I will create a backport to 0.4 |
pan3793
pushed a commit
to pan3793/RemoteShuffleService
that referenced
this pull request
Aug 30, 2024
…mory leaks This PR aims to fix a possible memory leak in ShuffleWriter. When we turn on `spark.speculation=true` or we kill the executing SQL, the task may be interrupted. At this time, `ShuffleWriter` may not call close. At this time, `DataPusher#idleQueue` will occupy some memory capacity ( `celeborn.client.push.buffer.max.size` * `celeborn.client.push.queue.capacity` ) and the instance will not be released. ```java Thread 537 (DataPusher-78931): State: TIMED_WAITING Blocked count: 0 Waited count: 16337 IsDaemon: true Stack: java.lang.Thread.sleep(Native Method) org.apache.celeborn.client.write.DataPushQueue.takePushTasks(DataPushQueue.java:135) org.apache.celeborn.client.write.DataPusher$1.run(DataPusher.java:122) ``` No Production testing <img width="547" alt="image" src="https://github.com/user-attachments/assets/d6f64257-144e-4139-96c6-518ca5f1bfd2"> <img width="479" alt="image" src="https://github.com/user-attachments/assets/e4ff62ec-5b9d-47a4-a36c-1d13bf378cbc"> Closes apache#2661 from cxzl25/CELEBORN-1544. Authored-by: sychen <[email protected]> Signed-off-by: zky.zhoukeyong <[email protected]>
pan3793
pushed a commit
to pan3793/RemoteShuffleService
that referenced
this pull request
Aug 30, 2024
…call abort to avoid memory leaks This PR aims to fix a possible memory leak in ShuffleWriter. Introduce a private abort method, which can be called to release memory when an exception occurs. apache#2661 Call the close method in the finally block, but the close method has `shuffleClient.mapperEnd`, which is dangerous for incomplete tasks, and the data may be inaccurate. No GA Closes apache#2663 from cxzl25/CELEBORN-1544-followup. Authored-by: sychen <[email protected]> Signed-off-by: zky.zhoukeyong <[email protected]>
cfmcgrady
pushed a commit
that referenced
this pull request
Sep 2, 2024
…id memory leaks Backport CELEBORN-1544 (#2661 and #2663) to branch-0.4 ### What changes were proposed in this pull request? This PR aims to fix a possible memory leak in ShuffleWriter. ### Why are the changes needed? When we turn on `spark.speculation=true` or we kill the executing SQL, the task may be interrupted. At this time, `ShuffleWriter` may not call close. At this time, `DataPusher#idleQueue` will occupy some memory capacity ( `celeborn.client.push.buffer.max.size` * `celeborn.client.push.queue.capacity` ) and the instance will not be released. ```java Thread 537 (DataPusher-78931): State: TIMED_WAITING Blocked count: 0 Waited count: 16337 IsDaemon: true Stack: java.lang.Thread.sleep(Native Method) org.apache.celeborn.client.write.DataPushQueue.takePushTasks(DataPushQueue.java:135) org.apache.celeborn.client.write.DataPusher$1.run(DataPusher.java:122) ``` ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Production testing #### Current <img width="547" alt="image" src="https://github.com/user-attachments/assets/d6f64257-144e-4139-96c6-518ca5f1bfd2"> #### PR <img width="479" alt="image" src="https://github.com/user-attachments/assets/e4ff62ec-5b9d-47a4-a36c-1d13bf378cbc"> Closes #2718 from pan3793/CELEBORN-1544-0.4. Authored-by: sychen <[email protected]> Signed-off-by: Fu Chen <[email protected]>
wankunde
pushed a commit
to wankunde/celeborn
that referenced
this pull request
Oct 11, 2024
…mory leaks ### What changes were proposed in this pull request? This PR aims to fix a possible memory leak in ShuffleWriter. ### Why are the changes needed? When we turn on `spark.speculation=true` or we kill the executing SQL, the task may be interrupted. At this time, `ShuffleWriter` may not call close. At this time, `DataPusher#idleQueue` will occupy some memory capacity ( `celeborn.client.push.buffer.max.size` * `celeborn.client.push.queue.capacity` ) and the instance will not be released. ```java Thread 537 (DataPusher-78931): State: TIMED_WAITING Blocked count: 0 Waited count: 16337 IsDaemon: true Stack: java.lang.Thread.sleep(Native Method) org.apache.celeborn.client.write.DataPushQueue.takePushTasks(DataPushQueue.java:135) org.apache.celeborn.client.write.DataPusher$1.run(DataPusher.java:122) ``` ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Production testing #### Current <img width="547" alt="image" src="https://github.com/user-attachments/assets/d6f64257-144e-4139-96c6-518ca5f1bfd2"> #### PR <img width="479" alt="image" src="https://github.com/user-attachments/assets/e4ff62ec-5b9d-47a4-a36c-1d13bf378cbc"> Closes apache#2661 from cxzl25/CELEBORN-1544. Authored-by: sychen <[email protected]> Signed-off-by: zky.zhoukeyong <[email protected]>
wankunde
pushed a commit
to wankunde/celeborn
that referenced
this pull request
Oct 11, 2024
…call abort to avoid memory leaks ### What changes were proposed in this pull request? This PR aims to fix a possible memory leak in ShuffleWriter. Introduce a private abort method, which can be called to release memory when an exception occurs. ### Why are the changes needed? apache#2661 Call the close method in the finally block, but the close method has `shuffleClient.mapperEnd`, which is dangerous for incomplete tasks, and the data may be inaccurate. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? GA Closes apache#2663 from cxzl25/CELEBORN-1544-followup. Authored-by: sychen <[email protected]> Signed-off-by: zky.zhoukeyong <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR aims to fix a possible memory leak in ShuffleWriter.
Why are the changes needed?
When we turn on
spark.speculation=true
or we kill the executing SQL, the task may be interrupted. At this time,ShuffleWriter
may not call close.At this time,
DataPusher#idleQueue
will occupy some memory capacity (celeborn.client.push.buffer.max.size
*celeborn.client.push.queue.capacity
) and the instance will not be released.Does this PR introduce any user-facing change?
No
How was this patch tested?
Production testing
Current
PR