8000 Race condition between MediaDriver start up and CommonContext.isDriverActive · Issue #385 · aeron-io/aeron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Race condition between MediaDriver start up and CommonContext.isDriverActive #385
Closed
@tom-smalls

Description

@tom-smalls

We are seeing one of our services fail to start up in our CI environment several times a day due to what we believe is a race condition between the MediaDriver starting, and writing it's contents to CncFileDescriptor (the service that fails is the first one we start after the MediaDriver).

CommonContext.isDriverActive is throwing an IllegalStateException because the CnC version it expects does not match the version in CncFileDescriptor; the version in the CncFileDescriptor is coming back as 0.

Looking at the code in MediaDriver.conclude(), we believe the issue lies here:

https://github.com/real-logic/aeron/blob/master/aeron-driver/src/main/java/io/aeron/driver/MediaDriver.java#L580

The file is being created and then populated, and we believe the MappedByteBuffer being passed into CommonContext.isDriverActive is not null but the data has not been written to it, hence the 0 CnC version.

We are looking at creating a PR where a temporary file is used for creation and population, and then copy to where the CncFileDescriptor should be.

We are running the Java (Client and MediaDriver) 1.3.0 version.

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

      0