|
56 | 56 |
|
57 | 57 | from .constants import LOG_TEMPLATE
|
58 | 58 | from .exceptions import RepositoryError
|
59 |
| -from .models import Domain, Feature, ImportedFile, Project |
| 59 | +from .models import Domain, ImportedFile, Project |
60 | 60 | from .signals import (
|
61 | 61 | after_build, after_vcs, before_build, before_vcs, files_changed)
|
62 | 62 |
|
@@ -219,10 +219,24 @@ def run(self, version_pk): # pylint: disable=arguments-differ
|
219 | 219 | except RepositoryError:
|
220 | 220 | # Do not log as ERROR handled exceptions
|
221 | 221 | log.warning('There was an error with the repository', exc_info=True)
|
| 222 | + except vcs_support_utils.LockTimeout: |
| 223 | + log.info( |
| 224 | + 'Lock still active: project=%s version=%s', |
| 225 | + self.project.slug, |
| 226 | + self.version.slug, |
| 227 | + ) |
222 | 228 | except Exception:
|
223 | 229 | # Catch unhandled errors when syncing
|
224 | 230 | log.exception(
|
225 | 231 | 'An unhandled exception was raised during VCS syncing',
|
| 232 | + extra={ |
| 233 | + 'stack': True, |
| 234 | + 'tags': { |
| 235 | + 'project': self.project.slug, |
| 236 | + 'version': self.version.slug, |
| 237 | + }, |
| 238 | + }, |
| 239 | + |
226 | 240 | )
|
227 | 241 | return False
|
228 | 242 |
|
@@ -557,7 +571,31 @@ def setup_vcs(self):
|
557 | 571 | version=self.version.slug,
|
558 | 572 | msg='Updating docs from VCS',
|
559 | 573 | ))
|
560 |
| - self.sync_repo() |
| 574 | + try: |
| 575 | + self.sync_repo() |
| 576 | + except RepositoryError: |
| 577 | + # Do not log as ERROR handled exceptions |
| 578 | + log.warning('There was an error with the repository', exc_info=True) |
| 579 | + except vcs_support_utils.LockTimeout: |
| 580 | + log.info( |
| 581 | + 'Lock still active: project=%s version=%s', |
| 582 | + self.project.slug, |
| 583 | + self.version.slug, |
| 584 | + ) |
| 585 | + except Exception: |
| 586 | + # Catch unhandled errors when syncing |
| 587 | + log.exception( |
| 588 | + 'An unhandled exception was raised during VCS syncing', |
| 589 | + extra={ |
| 590 | + 'stack': True, |
| 591 | + 'tags': { |
| 592 | + 'build': self.build['id'], |
| 593 | + 'project': self.project.slug, |
| 594 | + 'version': self.version.slug, |
| 595 | + }, |
| 596 | + }, |
| 597 | + ) |
| 598 | + |
561 | 599 | commit = self.project.vcs_repo(self.version.slug).commit
|
562 | 600 | if commit:
|
563 | 601 | self.build['commit'] = commit
|
|
0 commit comments