Recently, we have encountered with a deadlock issues regarding the GeoIp. Since this part wasn’t in use, it was decided that it needs to be shut down.
Exception: System.ExceptionMessage: Transaction (Process ID 56) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
Source: Sitecore.Kernel
at Sitecore.Data.DataProviders.Sql.DataProviderCommand.ExecuteReader()
at Sitecore.Data.DataProviders.Sql.DataProviderReader..ctor(DataProviderCommand command)
at Sitecore.Data.DataProviders.Sql.SqlDataApi.<>cDisplayClass12.b10()
at Sitecore.Data.DataProviders.NullRetryer.ExecuteT
at Sitecore.Data.DataProviders.Sql.SqlDataApi.CreateReader(String sql, Object[] parameters)
at Sitecore.Analytics.Data.DataAccess.DataAdapters.SqlBase.ReadMany(DataSourceQuery query, Action1 handler)
at Sitecore.Support.Analytics.TunedVisitEndWorker.LightVisit.LoadExpiredVisits(String connection, List1 expiredVisits)
at Sitecore.Support.Analytics.TunedVisitEndWorker.VisitEndWorker.GetExpiredVisits()
at Sitecore.Support.Analytics.TunedVisitEndWorker.VisitEndWorker.Process()
at Sitecore.Support.Analytics.TunedVisitEndWorker.VisitEndWorker.b__6(Object a)
Nested Exception
Exception: System.Data.DataException Message: Error executing SQL command: UPDATE TOP (@maxEntries) [Visits] SET [State] = 255, [StateChanged] = @now WHERE ([State] = 0 OR ([State] = 2 AND DateDiff(second, [StateChanged], @now) >= @completeTimeout)) AND DateDiff(second, [EndDateTime], @now) >= @sessionDurationWithDebt; SELECT [VisitId],[VisitorId] FROM [Visits] WHERE [STATE] = 255; UPDATE [Visits] SET [State] = 2 WHERE [State] = 255

In order to shut it down the following steps were provided:

<setting name=”Analytics.PerformLookup” value=”false” />

Removal of the following configs

  • Website\App_Config\Include\CES\Sitecore.CES.config
  • Website\App_Config\Include\CES\Sitecore.CES.DeviceDetection.config
  • Website\App_Config\Include\CES\Sitecore.CES.GeoIp.config
  • Website\App_Config\Include\CES\Sitecore.CES.GeoIp.LegacyLocation.config

but deadlocks continued to appear. Next step was to inspect Sitecore.Analytics.config. There were 2 processors which were triggering GeoIp:

<processor type=“Sitecore.Analytics.Pipelines.StartTracking.UpdateGeoIpData,Sitecore.Analytics” />

<processor type=“Sitecore.Analytics.Pipelines.CreateVisits.UpdateGeoIpData,Sitecore.Analytics” />

The solution was to remove them as well. After testing, the deadlocks were gone.