Hi , I have delay activity that is set on period of 60 days.
Code for timer initialization:
daWaitingForDocuments.TimeoutDuration =
TimeSpan.FromMinutes(60*1440); //60 daysValue from quickwatch inspector:
daWaitingForDocuments.TimeoutDuration {60.00:00:00} System.TimeSpan
this code is inside constructor, and it doesn't throw exception. But when state machine workflow enters state with delay activity it throws exception
Time-out interval must be less than 2^32-2.
Parameter name: dueTm
Is there some other way to assign timeout period to delay activity that will work
Thanks,
Indigo Cowboy

Delay activity - 60 days timeout perid error
Programmers
I now managed to reproduce the error. It turns out it occurs when running a workflow from a webapplication/service or WCF-service hosted by IIS and configured to use the ManualWorkflowSchedulerService.
I uploaded the repro-code to my blog. You can download it here.
(Make sure the webservice is configured to be hosted by IIS. Logging is enabled in the web.config, but will only work when the application-pool identity has sufficient rights (ie local admin)). I included the logfile that was generated when I reproduced the issue.
Since this is a blocking-issue for us, I think we will officially submit it. I'll let you know when there's a fix (or when it turns out I overlooked something
).
snuke
This shows a working example where the timer is scheduled for the 12/26/2006:
System.Workflow.Runtime Information: 0 : Queuing Service: Creating new Queue with ID -1042003712 for 745400ef-a7b0-4961-9843-12c6d958898e
System.Workflow.Runtime Information: 0 : WorkflowQueue:QueueItemAvailable subscribe for activity 'BasicListing' with context Id 5
System.Workflow.Runtime.Hosting Information: 0 : TimerEventSubscriptionQueue: 21a3ce95-6881-4096-9860-e4d6b959f4bd Enqueue Timer 745400ef-a7b0-4961-9843-12c6d958898e for 12/26/2006 23:39:46
System.Workflow.Runtime.Hosting Information: 0 : TimerEventSubscriptionQueue: 21a3ce95-6881-4096-9860-e4d6b959f4bd Schedule Timer 745400ef-a7b0-4961-9843-12c6d958898e for 12/26/2006 23:39:46
System.Workflow.Runtime.Hosting Information: 0 : ManualWorkflowSchedulerService: Schedule timer 745400ef-a7b0-4961-9843-12c6d958898e for workflow 21a3ce95-6881-4096-9860-e4d6b959f4bd at 12/26/2006 23:39:46
System.Workflow.Runtime Information: 0 : pending work hc 53898091 added workItem hc 61743308
System.Workflow.Runtime Information: 1 : Workflow Runtime: Scheduler: InstanceId: 21a3ce95-6881-4096-9860-e4d6b959f4bd : Done with running scheduled entry: SubscriptionEvent((5)BasicListing, ActivityStatusChange('(6)Initialization1', Closed, Succeeded))
System.Workflow.Runtime Information: 0 : Workflow Runtime: WorkflowExecutor: workflow instance '21a3ce95-6881-4096-9860-e4d6b959f4bd' has no work.
System.Workflow.Runtime Information: 0 : pending work hc 53898091 added workItem hc 18818860
this shows a failed timer being scheduled for 2/5/2007 and throwing the exception
System.Workflow.Runtime Information: 0 : Queuing Service: Creating new Queue with ID 1252473861 for 2315723b-02b2-4e56-9f6a-6b9593d51968
System.Workflow.Runtime Information: 0 : WorkflowQueue:QueueItemAvailable subscribe for activity 'BasicListing' with context Id 5
System.Workflow.Runtime.Hosting Information: 0 : TimerEventSubscriptionQueue: d1d6dc45-6a97-4bce-bff0-0fdb0272bde7 Enqueue Timer 2315723b-02b2-4e56-9f6a-6b9593d51968 for 02/05/2007 21:08:34
System.Workflow.Runtime.Hosting Information: 0 : TimerEventSubscriptionQueue: d1d6dc45-6a97-4bce-bff0-0fdb0272bde7 Schedule Timer 2315723b-02b2-4e56-9f6a-6b9593d51968 for 02/05/2007 21:08:34
System.Workflow.Runtime.Hosting Information: 0 : ManualWorkflowSchedulerService: Schedule timer 2315723b-02b2-4e56-9f6a-6b9593d51968 for workflow d1d6dc45-6a97-4bce-bff0-0fdb0272bde7 at 02/05/2007 21:08:34
System.Workflow.Runtime Error: 1 : Subscription handler of Activity BasicListing threw System.ArgumentOutOfRangeException: Time-out interval must be less than 2^32-2.
Parameter name: dueTm
at System.Threading.Timer..ctor(TimerCallback callback, Object state, TimeSpan dueTime, TimeSpan period)
at System.Workflow.Runtime.Hosting.ManualWorkflowSchedulerService.CreateTimerCallback(CallbackInfo info)
at System.Workflow.Runtime.Hosting.ManualWorkflowSchedulerService.OnFirstElementChanged(Object source, KeyedPriorityQueueHeadChangedEventArgs`1 e)
at System.Workflow.Runtime.KeyedPriorityQueue`3.RaiseHeadChangedEvent(V oldHead, V newHead)
at System.Workflow.Runtime.KeyedPriorityQueue`3.Enqueue(K key, V value, P priority)
at System.Workflow.Runtime.Hosting.ManualWorkflowSchedulerService.Schedule(WaitCallback callback, Guid workflowInstanceId, DateTime whenUtc, Guid timerId)
at System.Workflow.Runtime.TimerEventSubscriptionCollection.OnFirstElementChanged(Object source, KeyedPriorityQueueHeadChangedEventArgs`1 e)
at System.Workflow.Runtime.KeyedPriorityQueue`3.RaiseHeadChangedEvent(V oldHead, V newHead)
at System.Workflow.Runtime.KeyedPriorityQueue`3.Enqueue(K key, V value, P priority)
at System.Workflow.Runtime.TimerEventSubscriptionCollection.Enqueue(TimerEventSubscription timerEventSubscription)
at System.Workflow.Runtime.TimerEventSubscriptionCollection.Add(TimerEventSubscription item)
at System.Workflow.Activities.DelayActivity.System.Workflow.Activities.IEventActivity.Subscribe(ActivityExecutionContext parentContext, IActivityEventListener`1 parentEventHandler)
at System.Workflow.Activities.EventActivitySubscription.Subscribe(ActivityExecutionContext context, StateActivity state, IEventActivity eventActivity)
at System.Workflow.Activities.StateMachineSubscriptionManager.SubscribeEventActivity(ActivityExecutionContext context, IEventActivity eventActivity)
at System.Workflow.Activities.StateMachineSubscriptionManager.SubscribeEventDriven(ActivityExecutionContext context, EventDrivenActivity eventDriven)
at System.Workflow.Activities.SubscribeAction.Execute(ActivityExecutionContext context)
at System.Workflow.Activities.StateMachineExecutionState.ProcessActions(ActivityExecutionContext context)
at System.Workflow.Activities.StateActivity.EnteringLeafState(ActivityExecutionContext context)
at System.Workflow.Activities.StateActivity.HandleStateInitializationCompleted(ActivityExecutionContext context, StateInitializationActivity stateInitialization)
at System.Workflow.Activities.StateActivity.HandleChildActivityClosed(Object sender, ActivityExecutionStatusChangedEventArgs eventArgs)
at System.Workflow.ComponentModel.ActivityExecutorDelegateInfo`1.ActivityExecutorDelegateOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
System.Workflow.Runtime Information: 1 : Workflow Runtime: Scheduler: InstanceId: d1d6dc45-6a97-4bce-bff0-0fdb0272bde7 : Done with running scheduled entry: SubscriptionEvent((5)BasicListing, ActivityStatusChange('(6)Initialization1', Closed, Succeeded))
System.Workflow.Runtime Information: 0 : pending work hc 18667239 added workItem hc 61650457
System.Workflow.Runtime Information: 0 : Activity Status Change - Activity: BasicListing Old:Executing; New:Faulting
System.Workflow.Runtime.Tracking Information: 0 : TrackingListener::ActivityStatusChange - Received Activity Status Change Event for activity BasicListing
System.Workflow.Runtime Information: 0 : pending work hc 18667239 added workItem hc 21199173
Also its not 60 days when it stops working, its somewhere between 40 and 50 days (40 works, 50 throws the exception)
Gaurav.Srivastava
However if I run the the same workflow from a unit test, which effectivily is running it as an application a years delay (anything greater than 60days) works fine
Hugo
maxc
We are using the final bits (3.0.4203.2) and get this same error. I haven't managed to reproduce it in a simple isolated sample.
We read a datetime from the database, substract a timespan (TimeSpan.FromDays(14)) and determine the difference with the actual time (DateTime.Now). The final result is a positive TimeSpan of about 203 days. Still this exception occurs. My stacktrace looks similar to the one above:
kwihu.hau
Hi Steve,
Yes ti works fine until it reaches valuo of about 50 days. I got the sam error also when the timoutperiod is defined in design time for 60.00:00:00.
I founded workflow.dll, and when I look at the properties of the file I see file version 3.0.3603.6. I have wwf beta 2 installed ( February CTP).
Exception is not thrown when you set timeoutperiod inside the constructor of statemachine workflow, but when the workflowinstance enters state that has that delay activity.
I can send you sample application that has error, can you send me your email
Thanks,
Indigo Cowboy
dsnare
Bit confused here, glad you found that it is a bug, but who are you saying should submit it to MSFT
Tony Steele
hmmmm
The One
Hi,
I've looked at it and I have been able to repro it as well. We'll definitely look at it some more
Thanks
Sung Hon
Ponnette
hTp
Hi,
Does your code work if you use smaller time values What is the value of the TimeoutDuration that is set at Design Time for the Delay activity Could you provide some additional value I am unable to repro this behavior if I set a timeout on a delay for 60.00:00:00. What build of Workflow are you using
Thanks,
Steve Danielson [Microsoft]
This posting is provided "AS IS" with no warranties, and confers no rights.
Coolad
Igor1
Hi,
After more investigation, we think we found the cause (it is a bug). You definitely should submit it to MSFT and we'll see what we can do to fix it.
Thanks a lot for reporting this!
Sung Hon
sprague295
Thanks Tom, I already solved it by spliting timeout period.
Indigo Cowboy