Skip to content

Ordering of broadcast messages is not preserved #9

@colonelpanic8

Description

@colonelpanic8

I believe that this is because there is a race condition at

bcast/bcast.go

Line 112 in 79e4f35

}

and

bcast/bcast.go

Line 150 in 79e4f35

}

I believe that what is happening is that sometimes go routines that were scheduled later than other goroutines by these lines for a given channel get called first.

I see three ways to approach fixing this:

Option 1 is to simply bite the bullet and call out to each member's channel synchronously.
Option 2 is to start using a logical clock for events and passing those values through to the consumer
Option 3 also involves a logical clock, but it hides it from consumers by having an intermediate goroutine/channel pair running for each member that handles ensuring that the events are properly serialized

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