Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve reentrancy behavior/diagnostics during render loop processing #290

Open
jamieQ opened this issue Jul 29, 2024 · 0 comments
Open

Comments

@jamieQ
Copy link
Contributor

jamieQ commented Jul 29, 2024

today, reentrancy in the update/render loop can lead to various different behaviors depending on where it occurs. e.g.

  1. if an action is emitted to an ancestor node during action processing, the second action may complete before the first, and render the initial reusable sink invalid, thus dropping the action (we may or may not emit any diagnostics in this case... i can't recall offhand)
  2. if an action is emitted after action processing & rendering, but before the 'top-level' handling is complete (i.e. the logic to update the root workflow in WorkflowHost), some reentrant cases are attempted to be detected/diagnosed, but some will still cause problems (e.g. see the use case outlined in Workflow host observers are notified before internal updates are finished #289)

it would be nice if we had a more holistic story about how we should handle these reentrancy cases. some potential ideas to investigate:

  1. make sending actions via Sinks intrinsically asynchronous. this would presumably fix most (all?) crashes due to exclusivity violations for simultaneously mutating state, but might lead to silently ignoring things that may indicate potential issues.
  2. improve runtime detection of such reentrancy conditions. this was partially addressed here, but it seems not all potential cases of this manifest in the same way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant