Page MenuHomeVyOS Platform

REST API configure operation should not be defined as async
Closed, ResolvedPublicBUG

Description

In fixing the errors in retrieve operations in T5006, async was unnecessarily added to configure operations as well; this introduces a bug when a configure operation wants to itself make a call to the http-api. Though not common, perhaps, this is reasonable and supported, except for the bug introduced by overreach in addressing T5006.

The details: the web framework being used, FastAPI/Starlette handles non-async vs async functions by adding the former to a thread pool, which is itself awaited for execution; functions defined as async are run within an event-loop. For non-native async functions, defining them as async will introduce blocking within the event-loop: this is appropriate for retrieve operations that have no internal locking; undesirable for configure operations which do have locking and should not block.

Details

Version
vyos-1.4
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

jestabro changed the task status from Open to In progress.
jestabro triaged this task as Normal priority.
jestabro created this object in space S1 VyOS Public.
jestabro moved this task from Open to Finished on the VyOS 1.4 Sagitta board.

VyOS 1.3.3 Still have such an issue. Any plan to fix it on VyOS 1.3?

jestabro changed the task status from Resolved to Unknown Status.Jul 12 2023, 1:05 PM

Yes; it was not evident in 1.3.x until the upgrade of the FastAPI framework for
https://vyos.dev/T5176
and will be backported.

jestabro changed the task status from Unknown Status to Resolved.Aug 24 2023, 6:36 PM
jestabro moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus (1.3.4) board.