Notifications

363 views

Description

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.

https://<instance_name>.service-now.com/sysevent_list.do?sysparm_query=sys_created_onONToday%40javascript%3Ags.beginningOfToday()%40javascript%3Ags.endOfToday()%5Ename%3Ddiscovery.device.complete

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.

https://<instance_name>.service-now.com/sysevent_list.do?sysparm_query=sys_created_onONToday%40javascript%3Ags.beginningOfToday()%40javascript%3Ags.endOfToday()%5EstateNOT%20INprocessed%2Cerror%2Ctransferred%5EqueueISEMPTY

Workaround

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);
checkNextPhaseOrComplete();

function checkNextPhaseOrComplete() {

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

Related Problem: PRB1204788

Seen In

There is no data to report.

Fixed In

Jakarta Patch 6
Jakarta Patch 7
Kingston Patch 1
London

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-08-30 02:07:55
Published:2018-01-09