Skip to content

Commit

Permalink
Merge pull request pulp#2711 from dkliban/check-for-out-of-space-down…
Browse files Browse the repository at this point in the history
…load

Adds a check for 'No space left on device' on download failures
  • Loading branch information
dkliban authored Aug 18, 2016
2 parents a403880 + b7c8bfd commit 1484909
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/pulp/plugins/util/publish_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import time
import traceback
import uuid
import errno
import signal

from pulp.common import error_codes
from pulp.common.plugins import reporting_constants, importer_constants
Expand Down Expand Up @@ -1147,6 +1149,8 @@ def download_failed(self, report):
"""
self.progress_failures += 1
self.report_progress()
if os.strerror(errno.ENOSPC) in report.error_msg:
os.kill(os.getpid(), signal.SIGKILL)

def cancel(self):
"""
Expand Down
1 change: 1 addition & 0 deletions server/test/unit/plugins/util/test_publish_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,7 @@ def test_download_succeeded(self):
def test_download_failed(self):
dlstep = publish_step.DownloadStep('fake-step')
mock_report = Mock()
mock_report.error_msg = '404 encountered'
mock_report_progress = Mock()
dlstep.report_progress = mock_report_progress
dlstep.download_failed(mock_report)
Expand Down

0 comments on commit 1484909

Please sign in to comment.