Skip to content
This repository was archived by the owner on Sep 6, 2018. It is now read-only.
This repository was archived by the owner on Sep 6, 2018. It is now read-only.

DeadLock with LeaderChange/StateChange Events #161

@nemosupremo

Description

@nemosupremo

The setState function locks the state mutex that isn't unlocked when the event handlers are called. As a result if an event handler calls server.State() in response to a StateChange or LeaderChange event, the application can deadlock.

Example gist: https://gist.github.com/nemothekid/8576383

I think this can be fixed by either unlocked the mutex before the events are called, or moving the event callbacks inside a defer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions