Skip to content

Add execution quotas #77

@crertel

Description

@crertel

Idea

Similar to how luaerl has this has a way of specifying max reductions, it'd be neat to have that ability to limit both the max reductions (in BEAM-land) or the max lua bytecode instructions.

This would be helpful when sandboxing user code that might be poorly-behaved or which we want to more carefully timeshare.

Suggestions

  • Add optional max_reductions or max_instructions keys to Lua.eval!'s options param.
  • Change the return values in such cases: {:done, ...returned values..., ...returned state...} or {:exceeded_reductions, ...returned state...} or {:exceeded_instructions, ...returned state...}

Prior art

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions