Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.0.3, 3.1.2, 3.2.0, 3.3.0
-
None
Description
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:
if (objectsWritten > 0) { flush() } else { writer.revertPartialWritesAndClose() } success = true } finally { if (success) { writer.close() } else { ... } }
Code of ExternalSorter.spillMemoryIteratorToDisk as follows:
if (objectsWritten > 0) { flush() writer.close() } else { writer.revertPartialWritesAndClose() } success = true } finally { if (!success) { ... } }
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