Orchestration functions live in one process-wide map; two Runtime objects that register the same name share one function
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 58/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript
- Ambito
- backend, distributed-systems
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- JavaScript
- Stelle
- 36
- Fork
- 20
- Merge medio
- 20h 52m
- PR unite (30g)
- 4
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/duroxide-node
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
microsoft/duroxide-node#19 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 28/100
microsoft/duroxide-node#16 ·
Tutte le issue di microsoft/duroxide-node
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 3 giorni
-
audit.md numbers Theming and Responsive Design differently in the headings and the score tableForse già presa @pbakaus l’ha presa oggi. Apertaneeds triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
pbakaus/impeccable#979 ·
I maintainer di solito rispondono entro 1 giorno
-
area/web interface
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
mastodon/mastodon#40924 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
fireEvent.select does not wrap its automatic native focus in actForse già presa @sergioperezcheco l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
bug user-priority/P2
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
I maintainer di solito rispondono entro 1 giorno