Skip to content

Commit

Permalink
[infra] Try to handle failing to restore the crash resource limit ins…
Browse files Browse the repository at this point in the history
…tead.

Bug: #39662
Change-Id: Ib7401e050f7cc778ef3c020f2dbf5a7c46addde3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127164
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Karl Klose <karlklose@google.com>
  • Loading branch information
sortie committed Dec 5, 2019
1 parent 1a41670 commit 225682f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,15 +743,13 @@ def CheckLinuxCoreDumpPattern(fatal=False):
message = (
'Invalid core_pattern configuration. '
'The configuration of core dump handling is *not* correct for '
'a buildbot. The content of {0} must be "{1}" instead of "{2}".'
'(see https://github.com/dart-lang/sdk/issues/39662)'.format(
core_pattern_file, expected_core_pattern, core_pattern))
# TODO(39662): Remove this once we know why this happens
fatal = False
'a buildbot. The content of {0} must be "{1}" instead of "{2}".'.
format(core_pattern_file, expected_core_pattern, core_pattern))
if fatal:
raise Exception(message)
else:
print(message)
return True # TODO(39662): Remove once the core_pattern is fixed
return False
return True

Expand Down Expand Up @@ -807,7 +805,8 @@ def __enter__(self):
resource.setrlimit(resource.RLIMIT_CORE, (-1, -1))

def __exit__(self, *_):
resource.setrlimit(resource.RLIMIT_CORE, self._old_limits)
if self._old_limits != None:
resource.setrlimit(resource.RLIMIT_CORE, self._old_limits)


class LinuxCoreDumpEnabler(PosixCoreDumpEnabler):
Expand Down

0 comments on commit 225682f

Please sign in to comment.