SAP Knowledge Base Article - Preview

2729590 - Thread contention on cart objects involving promotions

Symptom

If a cart contains many items and promotions, performance may degrade when adding new items. For example, a grocery cart with more than 100 items and more than 25 promotions may exhibit slow performance when adding a new item. To improve performance in these situations, you can enable caching of promotion results.

The behavior can be observed in the thread dumps as a thread contention on cart objects, where one thread will hold the lock on a Cart object and other threads will be waiting to acquire it in order to do different kinds of operations, for example setting the delivery mode.

"hybrisHTTP1295" prio=5 tid=0x6730 nid=0x1a4a RUNNABLE - stats: cpu=24526 blk=-1 wait=-1
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at de.hybris.platform.promotions.jalo.PromotionsManager.evaluatePromotion(PromotionsManager.java:1049)
at de.hybris.platform.promotions.jalo.PromotionsManager.updateForActivePromotions(PromotionsManager.java:938)
at de.hybris.platform.promotions.jalo.PromotionsManager.updatePromotionsNotThreadSafe(PromotionsManager.java:886)
de.hybris.platform.promotions.jalo.PromotionsManager.updatePromotions(PromotionsManager.java:791)
- locked <5694f8f> (a de.hybris.platform.jalo.order.Cart)
at de.hybris.platform.promotions.impl.DefaultPromotionsService.updatePromotions(DefaultPromotionsService.java:242)

"hybrisHTTP433" prio=5 tid=0x9393 nid=0x24b1 BLOCKED owned by hybrisHTTP404 Id=9315 - stats: cpu=9098 blk=-1 wait=-1
java.lang.Thread.State: BLOCKED
at de.hybris.platform.jalo.order.AbstractOrder.setDeliveryMode(AbstractOrder.java:1280)
- waiting to lock de.hybris.platform.jalo.order.Cart@5694f8f
at sun.reflect.GeneratedMethodAccessor1224.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at de.hybris.platform.jalo.type.ReflectionAttributeAccess$AttributeMethod.invokeSetter(ReflectionAttributeAccess.java:794)
at de.hybris.platform.jalo.type.ReflectionAttributeAccess.setValue(ReflectionAttributeAccess.java:984)


Read more...

Environment

Any hybris version making use of the legacy Promotion Module (depcreated in 6.1) rather than the newer Promotion Engine.

Product

SAP Hybris Commerce 1808 ; SAP Hybris Commerce 6.0 ; SAP Hybris Commerce 6.1 ; SAP Hybris Commerce 6.2 ; SAP Hybris Commerce 6.3 ; SAP Hybris Commerce 6.4 ; SAP Hybris Commerce 6.5 ; SAP Hybris Commerce 6.6 ; SAP Hybris Commerce 6.7

Keywords

  • hybris
  • commerce
  • PromotionsManager
  • drools
  • slow performance 
  • coupon
  • voucher
, KBA , CEC-COM-CPS , SAP Commerce , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.