preventing CONCURRENT_MODIFCATION errors with offline user data jobs

261 views
Skip to first unread message

nc1969

unread,
May 15, 2023, 1:34:44 AM5/15/23
to Google Ads API and AdWords API Forum
Hello,

I am working with the google ads api and have been seeing these concurrent modification errors. would this approach work to try and limit these errors?

grabbing the user list for the offline user data job that hasn't been run yet, querying the job status at that user list resource, and sleeping if the status is RUNNING?

i'm having some trouble because it's not too clear which resource i should be querying... is this type of approach possible? thank you in advance.

Google Ads API Forum Advisor

unread,
May 15, 2023, 8:34:05 AM5/15/23
to nicole...@gmail.com, adwor...@googlegroups.com

Hi,

I'm from the Google Ads API team. I hope you're doing well today.

The CONCURRENT_MODIFICATION error occurs due to multiple processes that are trying to update the same entity at the same time. This also includes updating the entity in Google Ads UI while updating via the API as well. With that being said, we recommend waiting for about 30 seconds, then retry the request via API to avoid the CONCURRENT_MODIFICATION (https://developers.google.com/google-ads/api/reference/rpc/v13/DatabaseErrorEnum.DatabaseError?hl=en#concurrent_modification) error. 

For additional reference, our Customer Match documentation also suggests to avoid simultaneously running multiple OfflineUserDataJob processes that modify the same user list (that is, multiple jobs whose CustomerMatchUserListMetadata.user_list point to the same resource name). Doing so can result in a CONCURRENT_MODIFICATION error since multiple jobs are not permitted to operate on the same list at the same time. This error can also occur if attempting to simultaneously modify a list through the Google Ads UI and the Google Ads API. Note that this does not apply to adding operations to an existing job, which can be done at any time before the job is started.

Regarding your question, you may try querying the offline_user_data_job and check its status to determine if it's currently running. Afterwards, you may check the offline_user_data_job.customer_match_user_list_metadata.user_list to determine the the resource name of the remarketing list.

Let us know if you have other concerns.

Regards,

Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2lHreP:ref
Reply all
Reply to author
Forward
0 new messages