Skip to content

Thread safety on config values. #61

Description

@smudge

We have seen issues running demo mode with concurrency, and traced it to the fact that any config values on the DemoMode class itself are not thread safe and must be pre-heated before threads are spawned.

For example, this line might cause personas to return [] in a thread that had already loaded all of its persona files into memory:

    def personas
      unless instance_variable_defined?(:@personas)
        @personas = []
        auto_load_personas!
      end
      @personas
    end

The workaround for now is to preheat this config during application boot explicitly, but we should fix this more sustainably from within the gem itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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