Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Agent picking up same item repeatedly

SA-68641

Summary



The application is configured with a standard agent that is used to process child work objects. The queue items are generated with a Max Attempts value of 10. The user noticed that the queue item is being re-queued even though the child work object was processed successfully.

Error Messages



Cannot obtain a lock on instance ORG-APP-WORK <ID>, as Requestor <RequestorID> already has the lock


Steps to Reproduce

  1. Create a parent case and three child items for this case.
  2. Configure a standard agent to process the child cases.
  3. Queue three child cases to the agent where the agent activity will initiate a flow until the child item is processed to completion.


Root Cause



An issue in the custom application code or rules where a lock error in the activity caused the queue item to be re-queued and processed again

Resolution



The queue item shows the pyMaxAttempts set to 10 and the pyMinimumAgeForProcessing set to 500 milliseconds. To ensure the queue item does not get picked up again until the next agent run, you need to make sure that the pyMinimumAgeForProcessing value is longer than the interval for the agent.

The following article describes this scenario: 
https://community.pega.com/support/support-articles/all-attempts-execute-within-same-agent-run

Logic can also be added to the activity where the lock error occurred to check the status. If you still want to continue processing even though that step failed, use the Activity-Clear-Status method to clear the error.

Published December 19, 2018 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us