Browse Source

Fix racing-condition for files coming in after post-proc is started

Files could still come in after post-proc is already started. Post-proc could even have already deleted the job folder, resulting in Assembler errors for these new files. So when post-proc is active, it is safe to ignore write-errors.
Linked topic: https://forums.sabnzbd.org/viewtopic.php?f=3&t=23049
pull/1067/head
Safihre 8 years ago
parent
commit
a99d333272
  1. 4
      sabnzbd/assembler.py
  2. 3
      sabnzbd/postproc.py

4
sabnzbd/assembler.py

@ -97,8 +97,8 @@ class Assembler(Thread):
try:
filepath = self.assemble(nzf, filepath)
except IOError, (errno, strerror):
# If job was deleted, ignore error
if not nzo.is_gone():
# If job was deleted or in active post-processing, ignore error
if not nzo.is_gone() and not nzo.pp_active:
# 28 == disk full => pause downloader
if errno == 28:
logging.error(T('Disk full! Forcing Pause'))

3
sabnzbd/postproc.py

@ -219,6 +219,9 @@ class PostProcessor(Thread):
history_db.close()
nzo.purge_data(keep_basic=False, del_files=True)
# Processing done
nzo.pp_active = False
self.remove(nzo)
check_eoq = True

Loading…
Cancel
Save