Skip to content

Reloading or swapping rulesets at runtime: is it possible? #148

@flan

Description

@flan

Note: my preferred working environment is Python, but it's still early enough in my project's development cycle to change to something else.

Reading through other issues, I've seen some attempts at removing or installing additional rules by interacting directly with the rules module, as in #96 and #136, but I can't seem to find documentation for this, leading me to think it's unsupported. (The C code is easy to follow as a form of living documentation if I'm wrong, though)

What I'm hoping to do is slightly different from what I've seen before, though: create a full ruleset at runtime and replace the running ones, as a way of supporting operational exceptions without encoding all of the possible conditions into antecedents ahead of time. But it's not clear how to go about doing this: there doesn't seem to be a way to stop or pause rules execution after run_all() is called, and there are no locks around the rulesets list in the Python bindings, making me think that attempting to replace elements is likely not threadsafe.

Is replacing rulesets at runtime supported? If not, is there any simple way to transfer in-Redis context to a new client process so the system can restart with minimal downtime and state-loss?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions