elsa-workflows / elsa-workflows/elsa-core

[BUG] Delay node doesn't work when TimeSpan Input has the value of 72:00:00

Open
#5,978 2 comments 0 reactions 0 assignees View on GitHub
bug triaged
Dominant language
C#
Stars
7.9k
Forks
1.5k
Avg merge
15h 22m
Merged PRs (30d)
114

Description

## Description
Specifying the input value of 72:00:00 in the delay node creates a bookmark that has the resume at in 72 days in the elsa.bookmarks table but not on the instance. The impact is that the background service fails to process it and it crashes.
Anything above 25 days seems to fail.

## Steps to Reproduce
Add a delay node and add the value of 72:00:00 in the TimeSpan input.
Run the workflow
Restart the background service
The background service fails to start back up with the error of Invalid value '6220688071.5474' for parameter 'interval'.

4. **Reproduction Rate**: every time

## Expected Behavior
The background service processes the instance as per configuration

## Actual Behavior
The background service crashes

## Log Output
`fail: Microsoft.Extensions.Hosting.Internal.Host[9]
BackgroundService failed
System.ArgumentException: Invalid value '6220688071.5474' for parameter 'interval'.
at System.Timers.Timer..ctor(Double interval)
at Elsa.Scheduling.ScheduledTasks.ScheduledSpecificInstantTask.Schedule()
at Elsa.Scheduling.ScheduledTasks.ScheduledSpecificInstantTask..ctor(ITask task, DateTimeOffset startAt, ISystemClock systemClock, IServiceScopeFactory scopeFactory)
at InvokeStub_ScheduledSpecificInstantTask..ctor(Object, Span`1)
at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters)
at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance[T](IServiceProvider provider, Object[] parameters)
at Elsa.Scheduling.Schedules.SpecificInstantSchedule.Schedule(ScheduleContext context)
at Elsa.Scheduling.Services.LocalScheduler.ScheduleAsync(String name, ITask task, ISchedule schedule, IEnumerable`1 keys, CancellationToken cancellationToken)
at Elsa.Scheduling.Services.LocalScheduler.ScheduleAsync(String name, ITask task, ISchedule schedule, CancellationToken cancellationToken)
at Elsa.Scheduling.Services.DefaultWorkflowScheduler.ScheduleAtAsync(String taskName, DispatchWorkflowInstanceRequest request, DateTimeOffset at, CancellationToken cancellationToken)
at Elsa.Scheduling.Services.DefaultBookmarkScheduler.ScheduleAsync(IEnumerable`1 bookmarks, CancellationToken cancellationToken)`

## Troubleshooting Attempts
Setting the format of the TimeSpan to 72.00:00:00 yields the same result but smaller values like 3.00:00:00 seem to work.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.