The problem with processing multiple of "discovery.phase.complete" events is that they will consume the same sys_mutex key - which is bad


There is a problem with processing multiple discovery.phase.complete events because they will consume the same sys_mutex key. Because they have to fight over the mutex key, there can be a major delay in the processing of these events. What symptoms will you experience? Events are expected to be quick operations so they slow down other events in the queue.  The most obvious impact is that there can start to be a delay in emails.

Steps to Reproduce

  1. Create multiple discovery.phase.complete event (triggered via Discovery) on a Jakarta instance
  2. When these events are processed at the same time, notice that they have a long response time as compared to just one running at once.

How to check the run time of this event?

The processing duration field in the list below shows the amount of time it took for the event to process in milliseconds.


How to check if there is currently a delay in the processing of events?

The list below will show you all of the unprocessed events in the Default event queue.  The Created date of the event is when it was created so the time between when it was created and the current time is the delay in the event being processed.



Move the content of Script Action Discovery Phase Complete into Business Rule Discovery - Complete and then delete Script Action Discovery Phase Complete. Business Rule Discovery - Complete script should look like:

gs.eventQueue("discovery.phase.complete", current);

function checkNextPhaseOrComplete() {

    var dp = new DiscoveryPhaser(current);
    if (dp.hasNextPhase())
    current.state = "Completed";
    var d = new Discovery();

Related Problem: PRB1204788