elsa-core/src/modules/Elsa.Scheduling
Sipke Schoorstra e2a1b83ec8
Fix semaphore release logic in scheduled task execution (#7045)
* Fix semaphore release logic in scheduled task execution

- Ensure `_executionSemaphore` is only released when acquired.
- Refactor `acquired` variable initialization for better reliability and readability across `ScheduledRecurringTask`, `ScheduledCronTask`, and `ScheduledSpecificInstantTask`.

* Fix test isolation in WorkflowDefinitionActivity cache eviction test (#7046)

* Add thread-safety and resource disposal to `WorkflowDefinitionActivity`

- Introduced `SemaphoreSlim` to ensure thread-safe initialization.
- Implemented `IDisposable` to clean up semaphore resources.

* Introduce thread-safety in `CacheManager` with per-key locking

- Added `ConcurrentDictionary` for managing per-key `SemaphoreSlim` instances.
- Ensured thread-safe `GetOrCreateAsync` operations with key-specific locks.
- Cleaned up unused locks when cache entries are removed.

* Add definition IDs filter to WorkflowDefinitionActivityTests

- Updated `WorkflowInstanceFilter` to include `DefinitionIds` for more precise faulted workflow filtering.
- Improved test coverage for workflow definition scenarios.

* Revert "Introduce thread-safety in `CacheManager` with per-key locking"

This reverts commit cda89d4e6aea1810364cdb0145a59d7b6448bc49.

* Revert "Add thread-safety and resource disposal to `WorkflowDefinitionActivity`"

This reverts commit 08750890a16a8b539941d6d161b4061d2fdbe1b8.

* Remove unnecessary whitespace in WorkflowDefinitionActivityTests
2025-11-09 14:14:25 +01:00
..
Activities Remove Elsa.Expressions.Dsl module and related DSL features 2025-06-02 21:52:10 +02:00
Bookmarks Update bookmark payloads to public records for broader accessibility 2025-10-03 20:03:28 +02:00
Commands Remove Elsa.Expressions.Dsl module and related DSL features 2025-06-02 21:52:10 +02:00
Contracts Remove Elsa.Expressions.Dsl module and related DSL features 2025-06-02 21:52:10 +02:00
Extensions Remove Elsa.Expressions.Dsl module and related DSL features 2025-06-02 21:52:10 +02:00
Features Fix typo in AddTriggerPaylodValidator method name across Scheduling, Http, and Runtime modules 2025-10-04 19:34:19 +02:00
Handlers Introduce TenantDeleted event to handle tenant cleanup (#6843) 2025-08-06 08:43:39 +02:00
HostedServices Remove Elsa.Expressions.Dsl module and related DSL features 2025-06-02 21:52:10 +02:00
Models Remove Elsa.Expressions.Dsl module and related DSL features 2025-06-02 21:52:10 +02:00
Requests Remove Elsa.Expressions.Dsl module and related DSL features 2025-06-02 21:52:10 +02:00
ScheduledTasks Fix semaphore release logic in scheduled task execution (#7045) 2025-11-09 14:14:25 +01:00
Schedules Remove Elsa.Expressions.Dsl module and related DSL features 2025-06-02 21:52:10 +02:00
Services Remove Elsa.Expressions.Dsl module and related DSL features 2025-06-02 21:52:10 +02:00
Tasks Remove Elsa.Expressions.Dsl module and related DSL features 2025-06-02 21:52:10 +02:00
TriggerPayloadValidators Create trigger payload validation, refacto HttpEndpoint validator and create Cron validator (#6641) 2025-05-20 19:52:43 +02:00
Elsa.Scheduling.csproj Remove Elsa.Expressions.Dsl module and related DSL features 2025-06-02 21:52:10 +02:00
Elsa.Scheduling.csproj.DotSettings Remove Elsa.Expressions.Dsl module and related DSL features 2025-06-02 21:52:10 +02:00
FodyWeavers.xml Remove Elsa.Expressions.Dsl module and related DSL features 2025-06-02 21:52:10 +02:00
SchedulingStimulusNames.cs Remove Elsa.Expressions.Dsl module and related DSL features 2025-06-02 21:52:10 +02:00