8000 Enhances workflow runtime resilience and signaling by sfmskywalker · Pull Request #6643 · elsa-workflows/elsa-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Enhances workflow runtime resilience and signaling #6643

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

Merged
merged 8 commits into from
May 13, 2025

Conversation

sfmskywalker
Copy link
Member
@sfmskywalker sfmskywalker commented May 12, 2025

Improves the reliability and efficiency of the workflow runtime by:

  • Refactors the BookmarkQueueSignaler to use channels for more robust signaling.
  • Enhances the BookmarkQueueWorker to handle exceptions and continue processing.
  • Adds a new WorkflowInstanceNotFoundException for clearer error handling when workflow instances are not found.
  • Introduces a handler for WorkflowInstanceSaved to trigger bookmark queue processing upon workflow instance creation.
  • Updates the BulkDispatchWorkflows activity to use null defaults.
  • Clarifies comments related to bookmark and workflow instance checks during bookmark resumption.

Fixes #6642


This change is Reviewable

Replaced TaskCompletionSource with a bounded Channel to improve concurrency control and simplify the code. This change ensures better handling of multiple producers while maintaining a single reader model.
Replaced Debouncer with Throttler for rate limiting and added error handling to log exceptions and ensure the worker loop continues safely while allowing proper shutdown on cancellation.
Add exception handling for `WorkflowInstanceNotFoundException` to handle cases where the workflow instance does not exist. Log a debug message and return `ResumeBookmarkResult.NotFound()` when such instances are encountered. This ensures better error management and logging for bookmark resumption.
Replaced `default!` with `null!` for input properties to improve clarity and consistency. Renamed methods to better reflect their purpose, changing `CheckIfCompletedAsync` to `AttemptToCompleteAsync`. These changes enhance code readability and maintainability.
Replaced generic `InvalidOperationException` with `WorkflowInstanceNotFoundException` and `WorkflowGraphNotFoundException` for improved error context. This enhances clarity and enables more precise error handling.
Updated the property `WorkflowInstanceId` to u
8000
se `null!` instead of `default!` to better align with nullable reference type semantics. This ensures clarity and consistency in the codebase regarding expected default values.
Updated the SignalBookmarkQueueWorker to implement INotificationHandler for WorkflowInstanceSaved. This ensures that workflow instance save events now trigger the bookmark queue worker, improving event handling consistency.
Expanded the comment to explain that the queue item is stored not only when a bookmark is missing but also when the associated workflow instance is not yet in the database. This improves clarity for future maintainers regarding queuing conditions.
@sfmskywalker sfmskywalker merged commit 2dcd852 into develop/3.5.0 May 13, 2025
5 checks passed
@sfmskywalker sfmskywalker deleted the bug/6642 branch May 13, 2025 11:51
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

Successfully merging this pull request may close these issues.

2 participants
0