Orchestration functions live in one process-wide map; two Runtime objects that register the same name share one function
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 58/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript
- Lĩnh vực
- backend, distributed-systems
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- JavaScript
- Star
- 36
- Fork
- 20
- Merge trung bình
- 20 giờ 52 phút
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/duroxide-node
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
microsoft/duroxide-node#19 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 28/100
microsoft/duroxide-node#16 ·
Tất cả issue của microsoft/duroxide-node
Issue tương tự
-
bug user-priority/P2
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 78/100
opencart/opencart#15763 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
neondatabase/agent-skills#139 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Effect-TS/effect#8881 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
mail processing verified
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 7 ngày