Skip to content

Commit 225682f

Browse files
committed
[infra] Try to handle failing to restore the crash resource limit instead.
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>
1 parent 1a41670 commit 225682f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tools/utils.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -743,15 +743,13 @@ def CheckLinuxCoreDumpPattern(fatal=False):
743743
message = (
744744
'Invalid core_pattern configuration. '
745745
'The configuration of core dump handling is *not* correct for '
746-
'a buildbot. The content of {0} must be "{1}" instead of "{2}".'
747-
'(see https://github.com/dart-lang/sdk/issues/39662)'.format(
748-
core_pattern_file, expected_core_pattern, core_pattern))
749-
# TODO(39662): Remove this once we know why this happens
750-
fatal = False
746+
'a buildbot. The content of {0} must be "{1}" instead of "{2}".'.
747+
format(core_pattern_file, expected_core_pattern, core_pattern))
751748
if fatal:
752749
raise Exception(message)
753750
else:
754751
print(message)
752+
return True # TODO(39662): Remove once the core_pattern is fixed
755753
return False
756754
return True
757755

@@ -807,7 +805,8 @@ def __enter__(self):
807805
resource.setrlimit(resource.RLIMIT_CORE, (-1, -1))
808806

809807
def __exit__(self, *_):
810-
resource.setrlimit(resource.RLIMIT_CORE, self._old_limits)
808+
if self._old_limits != None:
809+
resource.setrlimit(resource.RLIMIT_CORE, self._old_limits)
811810

812811

813812
class LinuxCoreDumpEnabler(PosixCoreDumpEnabler):

0 commit comments

Comments
 (0)