subiquity/subiquity
Dan Bungert 71b71425d3 async_helpers: make SingleInstanceTask.wait safer
SingleInstanceTask has distinct steps for creation of the object, and
starting the task.  If a different coroutine is waiting on the
SingleInstanceTask, it isn't safe to directly call
SingleInstanceTask.wait() as the task may or may not have been created
yet.

Existing code usage of SingleInstanceTask is in 4 categories, with
reguards to SingleInstanceTask.wait():
1) using SingleInstanceTask without using SingleInstanceTask.wait().
   This is unchanged.
2) using SingleInstanceTask.wait without a check on task is not None.
   This may be safe now, but is fragile in the face of innocent-looking
   refactors around the SingleInstanceTask.
3) using SingleInstanceTask.wait after confirming that the task is not
   None.  This is fine but a leaky abstraction.
4) directly waiting on the SingleInstanceTask.task.  Another leaky
   abstraction, but it's solving a cancellation problem.  Leaving this
   alone.

By enhancing SingleInstanceTask.wait(), cases 2 and 3 are improved.  The
code not checking the task today is made safer, and the code checking
the task today can be simplified.
2023-03-17 08:39:01 -06:00
..
client Add the AD model into the POSTINSTALL_MODEL_NAMES 2023-03-01 10:36:20 -03:00
cmd remove --script/--click command line arguments 2022-12-07 14:56:00 +13:00
common storage/v2: endpoint for boot-plausible disks 2023-03-07 15:41:47 -07:00
models Consistent naming - part 2 - longer model name 2023-03-02 09:49:24 -03:00
server async_helpers: make SingleInstanceTask.wait safer 2023-03-17 08:39:01 -06:00
tests Merge pull request #1581 from CarlosNihelton/ad-autoinstall-deeng-587 2023-03-07 12:40:46 -03:00
ui Merge pull request #1552 from ogayot/fallback-mirror 2023-02-15 09:04:11 +01:00
__init__.py pep8 fix, imports at top 2018-05-24 16:59:32 -05:00
__main__.py loop: fix setuptools entry-points not using asyncio.run 2022-10-28 17:05:54 +02:00
journald.py journald: stop passing a loop 2022-12-06 16:58:21 -07:00
lockfile.py review feedback 2020-05-01 11:27:20 +12:00