diff options
| author | Robert Navarro <crshman@gmail.com> | 2026-09-12 18:04:16 -0700 |
|---|---|---|
| committer | Robert Navarro <crshman@gmail.com> | 2026-09-12 20:40:37 -0700 |
| commit | 387372db10ef8e63aa2171f1e4d3721aa1cc6cdb (patch) | |
| tree | a6e6ed86e296f9d3ec978a9f7a2d2982ac2af1aa /src/migration-scripts/interface | |
| parent | f226af1e4ad74902705cf0f6e810efb2045a536d (diff) | |
| download | vyos-1x-387372db10ef8e63aa2171f1e4d3721aa1cc6cdb.tar.gz vyos-1x-387372db10ef8e63aa2171f1e4d3721aa1cc6cdb.zip | |
configtree: T9307: serialize libvyosconfig calls across threads
libvyosconfig is not safe for concurrent entry. ctypes releases the GIL
for each foreign call, so threads in one process can be inside the
library at the same time; two concurrent from_string calls, or
from_string racing destroy, corrupt the shared parser state and
crash the process with SIGSEGV. vyos-http-api reaches this when a
configure operation runs in the threadpool while a retrieve is served
on the event loop.
Serialize every entry point on one process-wide RLock in the _Lib
wrapper. For the entry points that report through the library's global
error buffer, read the buffer while the lock is held and keep it per
thread, so get_error() returns the caller's own error; destroy, which
can run from __del__ between a failed call and get_error(), leaves it
untouched.
Diffstat (limited to 'src/migration-scripts/interface')
0 files changed, 0 insertions, 0 deletions
