venkata91 commented on a change in pull request #24265: [SPARK-27338][Core] Fix
deadlock in UnsafeExternalSorter.SpillableIterator when locking both
UnsafeExternalSorter.SpillableIterator and TaskMemoryManager
URL: https://github.com/apache/spark/pull/24265#discussion_r271481914
##########
File path:
core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java
##########
@@ -573,19 +573,26 @@ public boolean hasNext() {
@Override
public void loadNext() throws IOException {
- synchronized (this) {
- loaded = true;
- if (nextUpstream != null) {
- // Just consumed the last record from in memory iterator
- if (lastPage != null) {
- freePage(lastPage);
- lastPage = null;
+ MemoryBlock pageToFree = null;
+ try {
+ synchronized (this) {
+ loaded = true;
+ if (nextUpstream != null) {
+ // Just consumed the last record from in memory iterator
+ if(lastPage != null) {
+ pageToFree = lastPage;
Review comment:
Sure @cloud-fan, will add and update the PR
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]