Skip to content

Setup (with SetupBuildingScenario) fails intermittently due to eventually consistency of datastore #73

@stewartadam

Description

@stewartadam

Initializing a new ADT instance using SetupBuildingScenario can sometimes fail because of the eventual consistency in the backing datastore.

I tried a few times today and saw different errors at different points:

  1. sometimes, it claims that fields on the twin are not valid according to the model, despite the model having them (it seems the model was created, but not yet made available by backend yet so it thought the fields didn't exist)
  2. other times, the initial twin creation was successful but creating the relationships failed, claiming the twins did not exist yet (despite just having been created).

In either case, if I captured the net-traces using tools like mitmproxy, re-running the same REST call a few seconds later worked.

I suggest the sample introduce small delays between model creation, twin creation, and relationship creation to avoid this.

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