diff --git a/sabnzbd/nzbqueue.py b/sabnzbd/nzbqueue.py index 935376582a1..ad9e165d87c 100644 --- a/sabnzbd/nzbqueue.py +++ b/sabnzbd/nzbqueue.py @@ -864,6 +864,17 @@ def stop_idle_jobs(self): if not nzo.futuretype and not nzo.files and nzo.status not in (Status.PAUSED, Status.GRABBING): empty.append(nzo) + # Stall prevention by checking if all servers are in the trylist + # This is a CPU-cheaper alternative to prevent stalling + if len(nzo.try_list) == sabnzbd.downloader.Downloader.do.server_nr: + # Maybe the NZF's need a reset too? + for nzf in nzo.files: + if len(nzf.try_list) == sabnzbd.downloader.Downloader.do.server_nr: + # We do not want to reset all article trylists, they are good + nzf.reset_try_list() + # Reset main trylist, minimal performance impact + nzo.reset_try_list() + for nzo in empty: self.end_job(nzo) diff --git a/sabnzbd/nzbstuff.py b/sabnzbd/nzbstuff.py index bb22618d270..ca125171629 100644 --- a/sabnzbd/nzbstuff.py +++ b/sabnzbd/nzbstuff.py @@ -301,12 +301,6 @@ def remove_article(self, article, found): if found: self.bytes_left -= article.bytes - # The parent trylist is filled to the top, maybe too soon - # This is a CPU-cheaper alternative to prevent stalling - if len(self.nzo.try_list) == sabnzbd.downloader.Downloader.do.server_nr: - self.reset_try_list() - self.nzo.reset_try_list() - return (not self.articles) def set_par2(self, setname, vol, blocks):