spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Apache Spark (Jira)" <j...@apache.org>
Subject [jira] [Commented] (SPARK-36242) Ensure spill file closed before set success to true in ExternalSorter.spillMemoryIteratorToDisk method
Date Wed, 21 Jul 2021 10:00:20 GMT

    [ https://issues.apache.org/jira/browse/SPARK-36242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17384803#comment-17384803
] 

Apache Spark commented on SPARK-36242:
--------------------------------------

User 'LuciferYang' has created a pull request for this issue:
https://github.com/apache/spark/pull/33460

> Ensure spill file closed before set success to true in ExternalSorter.spillMemoryIteratorToDisk
method
> ------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-36242
>                 URL: https://issues.apache.org/jira/browse/SPARK-36242
>             Project: Spark
>          Issue Type: Improvement
>          Components: Spark Core
>    Affects Versions: 3.3.0
>            Reporter: Yang Jie
>            Priority: Minor
>
> The processes of ExternalSorter.spillMemoryIteratorToDisk and ExternalAppendOnlyMap.spillMemoryIteratorToDisk
are similar, but there are some differences in setting `success = true`
>  
> Code of ExternalSorter.spillMemoryIteratorToDisk as follows:
>  
> {code:java}
>       if (objectsWritten > 0) {
>         flush()
>       } else {
>         writer.revertPartialWritesAndClose()
>       }
>       success = true
>     } finally {
>       if (success) {
>         writer.close()
>       } else {
>         ...
>       }
>     }{code}
> Code of ExternalSorter.spillMemoryIteratorToDisk as follows:
> {code:java}
>   if (objectsWritten > 0) {
>     flush()
>     writer.close()
>   } else {
>     writer.revertPartialWritesAndClose()
>   }
>   success = true
> } finally {
>   if (!success) {
>     ...
>   }
> }{code}
> It seems that the processing of `ExternalSorter.spillMemoryIteratorToDisk` mehod is more
reasonable, We should make sure setting `success = true` after the spill file is closed
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message