RemoteEventReceiver race conditions

Expected Behavior of the Remote Event Receiver (RER)

  1. User makes some change on a SharePoint list, where an event listener is registered (change should trigger workflow start)
  2. SharePoint sends a change event to the Remote Event Receiver
  3. The remote event receiver forwards this event to the FireStart server
  4. The FireStart server requests the data from the SharePoint server
  5. The FireStart server checks, if the start condition is fulfilled and starts the Workflow (as the condition is fulfilled)
Sharepoint event chain

Unexpected Behavior: Workflow does not start

Due to high network latency or high load on the FireStart server, the following scenario can happen:

  1. The user makes a change to a SharePoint list where an event listener is registered (change should trigger workflow start)
  2. SharePoint sends a change event to the Remote Event Receiver
  3. The remote event receiver forwards this event to the FireStart Server
  4. The user reverts the change on the SharePoint list
  5. The FireStart server requests the changed data from the SharePoint server
  6. The FireStart server checks, if the start condition is fulfilled and does not start the Workflow (as the condition is not fulfilled)

In this scenario, it can happen that the start condition of the workflow is not valid anymore at the time, the FireStart server received the data from SharePoint.

Sharepoint event chain no start

Unexpected Behavior: Workflow starts twice

  1. The user makes a change to a SharePoint list where an event listener is registered (change should not trigger workflow start)
  2. SharePoint sends a change event to the Remote Event Receiver (event A)
  3. RER cannot reach the FireStart Server, event A will be cached on its disk
  4. The user makes some change on the same SharePoint list (change should trigger workflow start)
  5. SharePoint sends a change event to the Remote Event Receiver (event B)
  6. The remote event receiver forwards event B to the FireStart Server
  7. The FireStart server requests the data from the SharePoint server
  8. The FireStart server checks, if the start condition is fulfilled and starts the Workflow (as the condition is fulfilled)
  9. The RER recognizes that events can be delivered to the FireStart server and sends event A to the FireStart server
  10. The FireStart server requests the changed data from the SharePoint server
  11. The FireStart server checks, if the start condition is fulfilled and starts the Workflow (as the condition is fulfilled due to the change in event B)

 

Sharepoint event chain double