Azure-Samples / Azure-Samples/digital-twins-samples

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

Open
#73 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
127
Forks
92
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the SetupBuildingScenario initialization flow in the sample and trace the calls that create the model, twins, and relationships. Reproduce the intermittent failures and compare them with retries after a short wait. Done means a fresh ADT instance can be initialized reliably without model-availability or missing-twin errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
backend, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.