Open MariusVuscanNx opened 4 weeks ago
Based on the provided context, it seems that you are encountering issues with the default scheduling provider in Elsa 3.2.0-preview.1616. Here are the steps you can take to address the issues you've described:
Duplicate Executions on Republishing: When you republish a workflow, the existing triggers should be removed to prevent duplicate executions. This might be a bug in the current version you are using. You should check if there are any open issues on the Elsa GitHub repository or consider reporting this as a new issue.
Updating Cron Value: Similar to the first issue, when you update the cron value, the old triggers should be removed or overridden by the new ones. If this is not happening, it could also be a bug. Again, checking the GitHub issues or reporting a new one would be the recommended course of action.
Errors on Unpublishing a Workflow: If unpublishing a workflow is causing errors due to attempts to execute the workflow, this is likely a bug. Ensure that your workflow cancellation and cleanup logic is correctly implemented. If the issue persists, report it on GitHub.
Workaround: You mentioned that using the Quartz provider works as expected. If the default provider is not meeting your needs due to these issues, consider switching to Quartz.NET or Hangfire as a more stable alternative until the issues with the default provider are resolved.
Environment: Since you are using a preview version of Elsa, it is possible that you may encounter bugs that have not been identified or fixed yet. Always ensure you are using the latest stable version, or if you are using a preview version, keep an eye on the release notes for bug fixes related to your issues.
Mass Transit Disabled: If you have disabled Mass Transit, make sure that any related configuration or dependencies are also correctly adjusted to avoid conflicts or issues with the workflow execution.
Default Runtime: If you are using the default runtime and encountering these issues, consider exploring the distributed runtime options that Elsa offers, such as using Proto.Actor for a distributed, lock-free workflow execution across multiple nodes.
If you need further assistance, you can reach out to the Elsa community or maintainers through their GitHub repository or official communication channels.
This comment was generated by Glime.
Description
Configuring the scheduling activities with the default provider (neither quartz nor hangfire), in a single-node environment has a few issues like duplicate executions when updating an existing workflow and errors thrown when unpolishing a workflow.
Steps to Reproduce
Scenario 1: Unpublishing and publishing again will cause duplicate executions. Basically the first triggers will not be removed.
Scenario 2: Changing the value of the cron will have the same effect as scenario 2.
Scenario 3: Unpublishing a workflow will stop the timer but it is done by accident. The application will keep trying to execute the workflow but since it is unpublished it will throw this error:
The issues can be reproduced every time.
The startup configuration:
.UseScheduling()
Cron expressions used:
Expected Behavior
The expected behaviors are:
Workaround
Using the quartz provider is working as expected, without the issues mentioned.
Environment