Merge pull request #1886 from ogayot/probert-double-os-prober

filesystem: double probert timeout when running os-prober
This commit is contained in:
Olivier Gayot 2024-01-18 17:27:14 +01:00 committed by GitHub
commit eae97db849
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -1271,6 +1271,11 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
(False, ErrorReportKind.BLOCK_PROBE_FAIL, "block"), (False, ErrorReportKind.BLOCK_PROBE_FAIL, "block"),
(True, ErrorReportKind.DISK_PROBE_FAIL, "disk"), (True, ErrorReportKind.DISK_PROBE_FAIL, "disk"),
]: ]:
probert_timeout = 90.0
if self.app.opts.use_os_prober:
# We know that os-prober is going to be (very) slow on some
# systems, let's give probert more time.
probert_timeout *= 2
try: try:
start = time.time() start = time.time()
await self._probe_once_task.start( await self._probe_once_task.start(
@ -1279,7 +1284,7 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
# We wait on the task directly here, not # We wait on the task directly here, not
# self._probe_once_task.wait as if _probe_once_task # self._probe_once_task.wait as if _probe_once_task
# gets cancelled, we should be cancelled too. # gets cancelled, we should be cancelled too.
await asyncio.wait_for(self._probe_once_task.task, 90.0) await asyncio.wait_for(self._probe_once_task.task, probert_timeout)
except asyncio.CancelledError: except asyncio.CancelledError:
# asyncio.CancelledError is a subclass of Exception in # asyncio.CancelledError is a subclass of Exception in
# Python 3.6 (sadface) # Python 3.6 (sadface)