364 views

Description

When Web Service Import set API is used to insert and update records into a table, by default it uses fast lock. On certain cases, when multiple synchronous calls are made on the same table, this could lead to deadlock as the table is fast locked.

The logs show some errors similar to the following:

--localhost----
2017-12-15 05:30:27 (251) SOAP-thread-2 xxx9B21DB8F47C06536770C8C9619C9 WARNING *** WARNING *** Transaction: Cancelling transaction #13159629 /<source-table>.do (SOAPProcessorThread0a0fd3eddb4f47c06536770c8xxxxx: redirect count exceeded or request did not finish within 175 seconds - terminating request...): Thread SOAP-thread-2 (null, 310F9B21DB8F47C0653xxxx), after 175141ms
--localhost----

The threads show executing:

--active transactions SQL command -----
 "SELECT GET_LOCK('<instance>.ImportSetTransformer.<source_table>.<target-table>', <timeout>)"
--active transactions SQL command -----

Steps to Reproduce

  1. Create a synchronous Web Service Import set to incident
  2. Execute multiple updates in parallel on the Web Service against the incident table that take around 40 seconds each.
    • If you are affected by this problem, you will notice the record transformation is hold in pending state
    • Also, reviewing the threads.do on the instance, notice FastLock being invoked as per the stack trace :
---threads.do----
com.sun.proxy.$Proxy7.execute(Unknown Source)
com.glide.db.DBI.executeStatement0(DBI.java:1016)
com.glide.db.DBI.executeStatement(DBI.java:972)
com.glide.db.DBI.executeStatement(DBI.java:941)
com.glide.db.DBI.executeStatement(DBI.java:929)
com.glide.sys.lock.FastLock.get(FastLock.java:105)
---threads.do----

Workaround

In order to relieve any locked semaphore threads, a restart is required. 

To avoid the scenario from happening again, please toggle the following properties:

NameValueDescription
glide.db.ws.import_set_mutex_fast_lockfalse(Default:true) Set whether to use fast locks for WebService ImportSets
glide.db.import_set_mutex_fast_lockfalse(Default:true) Set whether to use fast locks for all non-WebService ImportSets

 


Related Problem: PRB1244501

Seen In

There is no data to report.

Intended Fix Version

London

Safe Harbor Statement

This "Intended Fix Version" information is meant to outline ServiceNow's general product direction and should not be relied upon in making a purchasing decision. The information provided here is for information purposes only and may not be incorporated into any contract. It is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for our products remains at ServiceNow's sole discretion.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-05-16 09:51:05
Published:2017-12-20