Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-20480

Fix exportWorklistAsZip behavior causing filesystem usage unnecessary growth

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 7.10, 8.3
    • Fix Version/s: None
    • Component/s: Web Common
    • Tags:
    • Backlog priority:
      700
    • Sprint:
      nxSL Sprint 8.4.4, nxSL Sprint 8.4.5, nxSL Sprint 8.10.1, nxSL Sprint 8.10.2, nxSL Sprint 9.1.1
    • Story Points:
      5

      Description

      When exporting the worklist as a ZIP, if any issue happens while building the ZIP file, the temporary file won't be deleted before the server is restarted. This can lead to a full filesystem if ZIP files are big.

      In DocumentListZipExporter.exportWorklistAsZip the temp file will be deleted when the VM terminates:

      tmpFile.deleteOnExit();
      

      Several problems appear below this, in the following code:

             try {
                  out.close();
                  fout.close();
              } catch (ZipException e) {
                  return null;
              }
              return tmpFile;
      
      1. there should be a finally statement testing if the returned value will be null, if it is the case then tmpFile should be deleted immediately
      2. fout is a FileOutputStream and close() method raises IOException not ZipException
      3. out is a ZipOutputStream and close() method can raise IOException as well as ZipException
      4. both exception types should be handled and a error message should be added to the logs containing the ZIP filename

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: