Skip to content

protect database with flock #1823

@slingamn

Description

@slingamn

We got a report of database corruption with v2.7.0. It's not entirely clear what happened but it's possible that two instances of Ergo were running concurrently, resulting in interleaving of updates to buntdb's append-only log.

Suggestion:

  1. Pull in https://github.com/gofrs/flock
  2. Wrap it in a package irc/flock with build flags that make it a no-op on unsupported platforms
  3. Acquire an exclusive flock on the buntdb database when opening it

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions