Skip to content

Hooks race condition #731

@dgunay

Description

@dgunay

We recently found a longstanding race condition in our test code that boiled down to the fact that zerolog reuses *Events in a sync.Pool. In one of our hooks, we store the *zerolog.Event and later read it when it had aleady been reclaimed by the pool once the event sends.

The Concurrency Safety section of the docs or the doc comments in the module itself may need an update to make this more obvious.

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