Microsoft.ServiceBus.Messaging.SessionLockLostException RRS feed

  • Question

  • Hi -

    We have workflow manager 1.0(CU2) and service bus 1.1)(CU2) installed on a  Win2k8R2 On-premise SharePoint 2013 farm. Workflow manager has been  installed on 3 SharePoint servers  in App layer .

    Issue: We are observing intermittent errors like below in the event log on any of workflow server and it is happening in Pre-prod and Prod too . When this happens, the current workflow suspends and re-triggers a duplicate workflow for the same instance which resulting data corruption with duplicate instance as per our application functionality design . 

    Error message :

    Log Name:      Microsoft-ServiceBus/Operational
    Source:        Microsoft-ServiceBus
    Date:          08/04/2016 06:19:57
    Event ID:      30504
    Task Category: (35030)
    Level:         Warning
    Keywords:      Broker
    User:          ********
    Computer:      ********
    SQL command processing error. Database info: Instance\DatabaseName. Exception: command text: [dbo].[SetEntityMetadataUpdateFlag], exception = Microsoft.ApplicationServer.Messaging.Broker.EntityLockLostException: Failed to lock entity WORKFLOWDEFAULTNAMESPACE:TOPIC:SHAREPOINT/DEFAULT/4BAA12BD-3139-4CE4-8F01-283A20041834/A79489F2-7AC9-4FAD-BC88-8E0F34C7E3C6/WFTOPIC with the specified epoch 210. The current epoch is 211.
       at Microsoft.ApplicationServer.Messaging.Broker.Sql.StoreUtilities.ValidateSqlResult(SqlDataReader reader, String entityName, SqlContainerLocation containerLocation)
       at Microsoft.Cloud.ServiceBus.Common.Sql.SqlStoreAsyncResult.SqlCommandAsyncResultCallback(IAsyncResult result). TrackingId: f9367ea2-7a17-4fb4-affc-9fa484a7bee1_Bpruswivproecm6, SubsystemId: NoSystemTracker.

    Any insights on this error would be greatly appreciated . 

    Regards , Riaz.

    • Moved by Asha99 Thursday, April 14, 2016 4:47 AM related to share point workflow manager
    Monday, April 11, 2016 11:44 AM

All replies

  • Hi,

    Thank you for posting here

    Thank you for reaching out to us. I am currently researching to gather more information with regards to your request. I shall revert back to you with an update at the earliest. Sincerely appreciate your patience.



    Tuesday, April 12, 2016 6:41 AM
  • I don't think you need to worry about this failure. Are you observing any issues rather than some lock failure traces?
    Tuesday, April 12, 2016 10:54 PM

    Hi Serkant,

    Appreciate your response . When service bus triggers lock lost exception error, Internally another instance will start for the same workflow on another workflow server, like you see in below image.

    Our custom functionality stores documents pertaining to a transaction to a document library  and does not allow the same document to be stored in  the same library again. Imagine a simple scenario,  the first instance of a workflow already stored documents 1.pdf and 2.pdf to a Test Document Library but abruptly session lock out error occurred and second instance of the same workflow starts  from scratch and tries to upload 1.pdf again  to Test Document Library and it fails due to aforementioned restriction of not allowing the same document again .It results in transaction failure.

    We want understand is this product by-design functionality?  Though current  session is lost , it acquires a new session on another server ? 

    Duplicate instance for the same workflow

    Regards , Riaz.

    Wednesday, April 13, 2016 10:09 AM
  • SessionLockLost might always happen and this is actually part of Service Bus farm topology in such cases Service Bus container moves from one back-end node to another. When this happens all locks will expire as expected.

    I'm not a SharePoint expert so I suggest carrying the thread to SharePoint category. SharePoint should be able to understand it is actually reprocessing a session and avoid duplicate workflow instances.

    Wednesday, April 13, 2016 6:09 PM