[MGNLUI-4548] Zip upload - temp folder not cleared Created: 09/Aug/18  Updated: 12/Mar/21  Resolved: 16/Nov/18

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: None
Fix Version/s: 5.7.2, 6.0

Type: Bug Priority: Neutral
Reporter: Siegried Zach Assignee: Mikaël Geljić
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 3h
Original Estimate: Not Specified

Issue Links:
causality
duplicate
duplicates MGNLDAM-655 ImportZipCommand does not remove it's... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Sprint: Saigon 158
Story Points: 1

 Description   

We had the following UseCase, which leads to huge temp folder content, which is not cleared

  • Uploading a zip file in the assets app
  • Will save the zip file in a temp folder (and not delete it)
  • The used temp folder is the one configured on system (e.g. tomcat) level
    • java.IO.File.createTempFile(...)
      in info.magnolia.ui.framework.command.ImportZipCommand.java:101 
  • The cleanup job should clear the temp folder
    • But it is working on a different configuration, it uses the Magnolia-Webapp temp folder
    • (magnolia.properties -> key: magnolia.upload.tmpdir)
      info.magnolia.cms.core.FileSystemHelper.java:75
      at info.magnolia.cms.core.Path.java:99
      at info.magnolia.ui.framework.command.CleanTempFilesCommand.java:68 
  • Thus these 2 processes not operating on the same temp folder, by heavy using the zip upload, the temp folder will grow
    • This should  not be the case. Probably it would be best if also the ZipUpload would use the Magnolia temp folder (defined by magnolia.upload.tmpdir)


 Comments   
Comment by Mercedes Iruela [ 09/Aug/18 ]

I would say that info.magnolia.ui.framework.command.ImportZipCommand.execute(Context) should use java.io.File.createTempFile(String, String, File) instead of java.io.File.createTempFile(String, String, File) as it is done in info.magnolia.publishing.packager.Packager or in info.magnolia.cms.filters.CosMultipartRequestFilter

Comment by Dai Ha [ 19/Nov/18 ]

Verify with:
magnolia-enterprise-pro-demo-bundle-5.7.2-20181116.122703-69-tomcat-bundle.zip
magnolia-enterprise-pro-demo-bundle-6.0-20181118.232456-634-tomcat-bundle.zip

Zip upload now moved to magnolia tmp directory. Aged files get deleted by cleanTempFiles schedule job.

Generated at Mon Feb 12 09:17:43 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.