Consider lazy durable entity state serialization semantics
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 30/100
Direção de pesquisa
Comece pela entidade central do Durable Task, StateShim, e rastreie como set_state(), get_state(), a conclusão de operações, rollback e exclusão lidam atualmente com o estado serializado. Compare a semântica de mutação com outros Durable Entity SDKs antes de decidir se a serialização adiada é apropriada. Adicione cobertura para mutação após set_state, falha de serialização, rollback, exclusão, wire payloads inalteradas e várias operações em um único batch.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Python
- Estrelas
- 40
- Forks
- 33
- Merge médio
- 2d 2h
- PRs com merge (30d)
- 6
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de microsoft/durabletask-python
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 45/100
microsoft/durabletask-python#268 ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 72/100
microsoft/durabletask-python#266 ·
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 38/100
microsoft/durabletask-python#249 ·
-
bug Functions Parity
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
microsoft/durabletask-python#241 · 2 comentários ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 76/100
microsoft/durabletask-python#222 ·
Todas as issues de microsoft/durabletask-python
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
anthropics/skills#1811 · 1 comentário ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
speaches-ai/speaches#678 ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
datalayer/mcp-compose#42 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
conda-forge/spacy-feedstock#177 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
UKGovernmentBEIS/inspect_evals#2523 ·