Page MenuHomeVyOS Platform

Make the config lexer reentrant
Closed, ResolvedPublic

Description

Because the config syntax we inherited from Vyatta is highly ambiguous, it requires a lexer hack to parse correctly: the lexer keeps track of an internal state to determine whether a newline is just a newline or a leaf node terminator.

Right now that state is implemented as a mutable reference. That makes the lexer code non-reentrant and thread-unsafe. Not a big problem now that OCaml still has a global runtime lock and our commits are also strictly sequential, but both of those will change in the future. OCaml 5.0 removes the global lock and adds a multi-core GC, and VyOS is also getting closer to a point when we can actually replace the backend.

It would be nice to ensure that our code is re-entrant by that point.

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Improvement (missing useful functionality)

Event Timeline

dmbaturin triaged this task as Wishlist priority.Apr 1 2022, 9:12 PM
dmbaturin created this task.