Paul Rogers created DRILL-5055:
----------------------------------

             Summary: External Sort does not delete spill file if error occurs 
during close
                 Key: DRILL-5055
                 URL: https://issues.apache.org/jira/browse/DRILL-5055
             Project: Apache Drill
          Issue Type: Bug
    Affects Versions: 1.8.0
            Reporter: Paul Rogers
            Assignee: Paul Rogers
            Priority: Minor


DRILL-3898 recently fixed a case in which disk space was exhausted during a 
spill event for the external sort. In this case, the call to close failed 
because close attempted to flush remaining buffered data, but that also failed 
due to out of space.

While the fix works, the fix causes the partially-completed spill file to be 
left on disk. Consider this code in {{BatchGroup.close( )}}

{code}
    if (outputStream != null) {
      outputStream.close();
    }
    ...
    if (fs != null && fs.exists(path)) {
      fs.delete(path, false);
    }
{code}

Notice that, if the output stream close fails, the spill file is not deleted. 
The fix is to put the delete in a finally block so that it is always deleted.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to