summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRobert Navarro <crshman@gmail.com>2026-09-12 18:04:16 -0700
committerRobert Navarro <crshman@gmail.com>2026-09-12 20:40:37 -0700
commit387372db10ef8e63aa2171f1e4d3721aa1cc6cdb (patch)
treea6e6ed86e296f9d3ec978a9f7a2d2982ac2af1aa /scripts
parentf226af1e4ad74902705cf0f6e810efb2045a536d (diff)
downloadvyos-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 'scripts')
0 files changed, 0 insertions, 0 deletions