Investigate the delay in publishing the ITEM_CHECKED_OUT event using mod-pubsub

Description

This ticket follows from . It was discovered that a significant amount of time, during checkout  = 9sec, publishing of  ITEM_CHECKED_OUT takes 7.6sec:

Furthermore, while monitoring threads within the pubsub container, it was observed that with each checkout, the number of threads increases up to 20. However, these threads do not get released afterward. The attempt to adjust the thread pool size to 30 did not impact the number of active threads. Even when enforcing a maximum execution time of 2 minutes, the threads did not free up as expected:

Additionally, the closing of sharedProducer has been moved to the finally block of the handler to ensure the proper closure of the shared producer, especially in scenarios where an issue might occur during sharedProducer.write().
Metrics collected using Rancher before and after implementing the mentioned changes for mod-pubsub show not significant differences:

before:


after:

Attached are logs from mod-pubsub for further investigation:

Environment

None

Potential Workaround

None

Attachments

7

Checklist

hide

TestRail: Results

Activity

Show:

Details

Assignee

Reporter

Priority

Development Team

Vega

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created November 15, 2023 at 2:47 PM
Updated March 6, 2025 at 10:44 PM
TestRail: Cases
TestRail: Runs