Consider lazy durable entity state serialization semantics
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
Hướng nghiên cứu
Bắt đầu với thực thể Durable Task cốt lõi StateShim và theo dõi cách set_state(), get_state(), việc hoàn tất operation, rollback và deletion hiện xử lý state đã serialize. So sánh ngữ nghĩa mutation với các Durable Entity SDKs khác trước khi quyết định liệu deferred serialization có phù hợp hay không. Bổ sung coverage cho mutation sau set_state, serialization failure, rollback, deletion, wire payload không thay đổi và nhiều operation trong một batch.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Durable entity state is currently serialized eagerly when set_state() is called. This snapshots the value immediately, so mutations made to the same Python object after set_state() do not affect the state eventually persisted at the end of the operation.
state = Point(1)
self.set_state(state)
state.value = 99
The persisted state is Point(1), not Point(99).
This may surprise Python users who expect ordinary reference semantics and could introduce subtle bugs when entity code mutates an object after passing it to set_state().
Scope
The behavior is implemented in the core durabletask entity StateShim, so it affects core durabletask entities and providers built on it, including durabletask-azuremanaged and azure-functions-durable.
Current rationale
Eager serialization was introduced intentionally to:
- surface serialization errors inside the operation that called
set_state(); - preserve per-operation rollback behavior in an entity batch;
- retain the original serialized wire payload when state is unmodified; and
- prevent mutations to values returned by
get_state()from implicitly changing persisted state without a correspondingset_state().
Design question
Should set_state() retain the live value and defer serialization until successful operation completion, so mutations made after set_state() but before the operation returns are persisted?
If so, the design needs to define:
- whether
get_state()afterset_state()returns the same pending live object or a reconstructed copy; - where serialization occurs so serialization failures still fail and roll back the current operation;
- behavior across multiple operations in one entity batch;
- compatibility implications of changing
set_state()from snapshot-at-call semantics to retain-reference-until-commit semantics; and - consistency with Durable Entity semantics in other language SDKs.
Suggested investigation
- Compare mutation semantics with other Durable Entity SDKs.
- Prototype deferred serialization at the operation commit boundary.
- Add tests for post-
set_state()mutation, serialization failure, rollback, deletion, unmodified wire payloads, and multiple operations in one batch. - Document the current requirement to perform mutations before the final
set_state()call unless the behavior changes.
- Ngôn ngữ chính
- Python
- Star
- 40
- Fork
- 33
- Merge trung bình
- 2 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 6
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/durabletask-python
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
microsoft/durabletask-python#268 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
microsoft/durabletask-python#266 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
microsoft/durabletask-python#249 ·
-
bug Functions Parity
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
microsoft/durabletask-python#241 · 2 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
microsoft/durabletask-python#222 ·
Tất cả issue của microsoft/durabletask-python
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
learningequality/ricecooker#747 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
run-llama/llama_index#23199 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
KhronosGroup/glTF-Blender-IO#2769 ·