PodError: temp folder already exists

Asked by Luc Saffre on 2011-03-17

Today we had the following error:

  File "/var/snapshots/appy-0.6.3/appy/pod/renderer.py", line 146, in __init__
    self.prepareFolders()
  File "/var/snapshots/appy-0.6.3/appy/pod/renderer.py", line 305, in prepareFolders
    raise PodError(TEMP_FOLDER_EXISTS % self.tempFolder)
PodError: I need to use a temp folder "/usr/local/django/dsbe_eupen/media/cache/appypdf/contacts.Person-22315.pdf.temp"
but this folder already exists.

I had to manually delete the specified directory. So there must be at least one possible situation where appy.pod does not delete the temp folder. I suspect that it happens when a user double-clicks on the print button (i.e. a second call for the same file while the first call is still running). The problem is not that the second print request fails. The problem is that the first request won't tidy up in this case. Note that the temporary directory was not empty.

Is this a known problem?

Luc

Question information

Language:
English Edit question
Status:
Solved
For:
Appy Edit question
Assignee:
No assignee Edit question
Solved by:
Gaëtan Delannay
Solved:
2011-03-23
Last query:
2011-03-23
Last reply:
2011-03-22

Hi Luc,
Thanks! It was a problem I was hunting for a while. I'll try to create a temp folder with a unique name including time.time(), such that several Renderers can concurrently work on the same template without interferring.
I've created a bug report for this.
Cheeeeeers
Gaetan

Luc Saffre (luc-saffre) said : #2

Yes, using a timestamp in the name of the temp folder should solve this problem in an elegant way (+allowing concurrent renderings). Good luck!