Orchestration functions live in one process-wide map; two Runtime objects that register the same name share one function
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 58/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript
- Área
- backend, distributed-systems
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- JavaScript
- Estrellas
- 36
- Forks
- 20
- Merge medio
- 20 h 52 min
- PR fusionados (30 d)
- 4
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/duroxide-node
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
microsoft/duroxide-node#19 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 28/100
microsoft/duroxide-node#16 ·
Todos los issues de microsoft/duroxide-node
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
[quality] useFocusTrap's Shift+Tab wrap and non-Tab/non-Escape key arms are never driven end to endPosiblemente ocupada @hivecommons-hive la tomó hoy. Abiertoagent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5n31 quality testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
[aw] Upgrade availableAbiertoagentic-workflows
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
githubnext/gh-aw-workshop#4220 ·
Los mantenedores suelen responder en 1 día