Cancelling HTTP calls from client side cause server side failure
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
subiquity |
New
|
Undecided
|
Unassigned |
Bug Description
It seems that cancelling HTTP calls from the client side of Subiquity end-up causing failures on the server side. It is easy to reproduce for the drivers controller but other components (such as storage, snaplist, ...) are also affected.
Context: this happened to me in the storage controller when implementing cancellation of probing tasks in the end_ui() method.
HTTP calls are automatically cancelled on the client side when an asyncio.
One way to test how the server responds to such events is to use curl and send it a SIGINT (ctrl-c).
The issue can be reproduced in dry-run mode:
$ make dry-run
$ curl --unix-socket .subiquity/socket 'http://
^C
$ tail .subiquity/
[...]
2022-04-12 12:59:21,268 DEBUG root:39 finish: subiquity/
2022-04-12 12:59:22,597 ERROR root:39 finish: subiquity/
2022-04-12 12:59:22,597 ERROR root:39 finish: subiquity/
2022-04-12 12:59:22,597 ERROR root:39 finish: subiquity/
$ curl --unix-socket .subiquity/socket 'http://
curl: (52) Empty reply from server
$ tail .subiquity/
2022-04-12 12:59:22,597 ERROR root:39 finish: subiquity/
2022-04-12 12:59:22,597 ERROR root:39 finish: subiquity/
2022-04-12 13:01:29,533 DEBUG root:39 start: subiquity/
2022-04-12 13:01:29,533 ERROR root:39 finish: subiquity/
The consequences vary from one controller to another, but in most cases it results in a crash in the installer or the GUI showing the progress screen indefinitely.
tags: | added: fr-2253 |
Upon closing a HTTP socket / cancelling a task on the client side, the server side reacts by raising a asyncio. CancelledError exception.
This behavior could be intentional or not.
I haven't yet figured out if the exception is raised by Subiquity itself, by aiohttp or by something else.