Orchestration functions live in one process-wide map; two Runtime objects that register the same name share one function
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 58/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- javascript
- Bereich
- backend, distributed-systems
Rechercherichtung
Start in lib/duroxide.js at the module-level map, registerOrchestration, registerOrchestrationVersioned, and createGenerator. Run the two-Runtime reproduction using separate SQLite stores and trace how each Runtime registers its create callback. Done means identical orchestration names can resolve to different functions per Runtime without changing activity behavior or causing cross-runtime replay failures.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
registerOrchestration stores the generator function in a module-level Map, keyed by name or by name@version. Every Runtime in the process shares that map. If two Runtime objects register the same orchestration name, both run the function that was registered last.
Where
- The map: https://github.com/microsoft/duroxide-node/blob/9fb6b853f6fa0d84da81e761e4c0bf288217f70d/lib/duroxide.js#L26
- The writes in
registerOrchestrationandregisterOrchestrationVersioned: https://github.com/microsoft/duroxide-node/blob/9fb6b853f6fa0d84da81e761e4c0bf288217f70d/lib/duroxide.js#L1141 and https://github.com/microsoft/duroxide-node/blob/9fb6b853f6fa0d84da81e761e4c0bf288217f70d/lib/duroxide.js#L1183 - The lookup in
createGenerator: https://github.com/microsoft/duroxide-node/blob/9fb6b853f6fa0d84da81e761e4c0bf288217f70d/lib/duroxide.js#L44
Reproduction
const pA = await SqliteProvider.open('sqlite:/tmp/a.db');
const pB = await SqliteProvider.open('sqlite:/tmp/b.db');
const rtA = new Runtime(pA);
const rtB = new Runtime(pB);
rtA.registerOrchestration('Greet', function* () { return 'from runtime A'; });
rtB.registerOrchestration('Greet', function* () { return 'from runtime B'; });
await rtA.start();
await rtB.start();
const cA = new Client(pA);
await cA.startOrchestration('on-a', 'Greet', null);
const a = await cA.waitForOrchestration('on-a', 10000);
// The instance is in store A. Only runtime A can run it.
// a.output is "from runtime B".
Activities do not have this problem. Each Runtime passes its activity callbacks to its own native runtime.
Impact
- Two runtimes in one process cannot use the same orchestration name with different code. Examples are one runtime per store or per tenant, and two test fixtures in one test process. The wrong code runs, and there is no error.
- If the two functions differ, a replay can also fail with a nondeterminism error.
Suggested fix
Keep the map per Runtime. For example, each Runtime registers its own create callback, and that callback looks up the function in the map of its Runtime.
Tracked in microsoft/duroxide#55.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 36
- Forks
- 20
- Ø Merge
- 20 Std. 52 Min.
- Gemergte PRs (30 T.)
- 4
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoft/duroxide-node
-
bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 65/100
microsoft/duroxide-node#19 ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 28/100
microsoft/duroxide-node#16 ·
Alle Issues in microsoft/duroxide-node
Ähnliche Issues
-
[Feature]:Offenenhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 73/100
Uuriko/project-room#1554 ·
Maintainer antworten meist innerhalb von 1 Tag
-
automated issue report
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
lirantal/discoprint#36 ·
Maintainer antworten meist innerhalb von 1 Tag
-
accepting PR Content:HTML
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
mdn/content#45988 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
pnpm/pnpm#16635 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag