SenseNet / sensenet

Open Source Content Services Platform written in .NET
https://sensenet.com
GNU General Public License v2.0
173 stars 112 forks source link

RegisterWait in Workflow has wrong WorkflowInstancePath #52

Closed borsi closed 7 years ago

borsi commented 7 years ago

...which results in wakeup errors on NotifyContextChanged

This time to do with the wake up workflows to continue for when a Task changes that you are looking at with "WaitForContentChanged" workflowaction...

The problem is in the CreateBookmark I think, somehow the context in Execute (line 32 of WaitForContentChanged.cs) has the wrong WorkflowInstancePath (ContentWorkflowExtension) from another Running workflow, maybe .

Therefor the bookmark it creates is wrong cause it points to a a different workflow.

And so on NotifyContextChanged (at Save of Task) it can't load the workflowapp and continue

1 2016-10-27 10:49:00.97764 Workflow A:/LM/W3SVC/2/ROOT-1-131220189108567528 T:58 WF: NotifyContentChanged: Loaded notifications for Content#869782: count:1, items:[[668c6630-6402-42ea-8bcb-d77bd0a6240f]] 2 2016-10-27 10:49:00.97764 Workflow A:/LM/W3SVC/2/ROOT-1-131220189108567528 T:58 ERROR CreateWorkflowApplication: System.NullReferenceException: Object reference not set to an instance of an object... at SenseNet.Workflow.InstanceManager.CreateWorkflowApplication(WorkflowHandlerBase workflowMasterInstance, WorkflowApplicationCreationPurpose purpose, IDictionary2 parameters) in c:\Builds\5\SenseNet\PACKAGEEnterprise\Sources\Source\SenseNet\Workflow\InstanceManager.cs:line 162 3 2016-10-27 10:49:00.97764 Workflow A:/LM/W3SVC/2/ROOT-1-131220189108567528 T:58 ERROR FireNotification: System.NullReferenceException: Object reference not set to an instance of an object... at SenseNet.Workflow.InstanceManager.CreateWorkflowApplication(WorkflowHandlerBase workflowMasterInstance, WorkflowApplicationCreationPurpose purpose, IDictionary2 parameters) in c:\Builds\5\SenseNet\PACKAGEEnterprise\Sources\Source\SenseNet\Workflow\InstanceManager.cs:line 206.. at SenseNet.Workflow.InstanceManager.FireNotification(WorkflowNotification notification, WorkflowNotificationEventArgs eventArgs) in c:\Builds\5\SenseNet\PACKAGEEnterprise\Sources\Source\SenseNet\Workflow\InstanceManager.cs:line 429 4 2016-10-27 10:49:00.97764 Workflow A:/LM/W3SVC/2/ROOT-1-131220189108567528 T:58 ERROR NotifyContentChanged: System.NullReferenceException: Object reference not set to an instance of an object... at SenseNet.Workflow.InstanceManager.CreateWorkflowApplication(WorkflowHandlerBase workflowMasterInstance, WorkflowApplicationCreationPurpose purpose, IDictionary`2 parameters) in c:\Builds\5\SenseNet\PACKAGEEnterprise\Sources\Source\SenseNet\Workflow\InstanceManager.cs:line 206.. at SenseNet.Workflow.InstanceManager.FireNotification(WorkflowNotification notification, WorkflowNotificationEventArgs eventArgs) in c:\Builds\5\SenseNet\PACKAGEEnterprise\Sources\Source\SenseNet\Workflow\InstanceManager.cs:line 446.. at SenseNet.Workflow.InstanceManager.NotifyContentChanged(WorkflowNotificationEventArgs eventArgs) in c:\Builds\5\SenseNet\PACKAGEEnterprise\Sources\Source\SenseNet\Workflow\InstanceManager.cs:line 467

Which you can see from below select where I join the workflownotifications table with the instancestable.

SELECT TOP 1000 w.NotificationId ,w.NodeId ,w.WorkflowInstanceId ,w.WorkflowNodePath ,w.BookmarkName, n.BlockingBookmarks FROM [SenseNetContentRepository].[dbo].[WorkflowNotification] as w INNER JOIN [SenseNetContentRepository].[System.Activities.DurableInstancing].[InstancesTable] as n ON w.WorkflowInstanceId = n.Id where BookmarkName <> SUBSTRING(BlockingBookmarks,2,36)

Following Select gives me the results in the attachment. As you will see bookmark names aren't matching.

How this happens I have no clue... Somehow the Workflow must be running with bad WorkflowInstancePath when you execute WaitForContentChanged

pietervanh commented 7 years ago

Workflow Start Create a ATask Parallel : WaitOnContentChanged(ATask) | Delay(10min) Delay happens. Workflow starts up again Creates new BTask WaitOnContentChanged(BTask) BTask Save -> Error

So my reasoning is that it goes wrong in the wakeup workflow after delay it's probably running with wrong workflowpath there.

after Delay Wakeup new Task then WaitOnContentChanged for the new Task = Error