I'm trying to create huge group of Ads. I have configured campaigns and AdGroups already.
I use bulk mutate method:
https://developers.google.com/google-ads/api/reference/rpc/v13/GoogleAdsService#mutate and V13 version in dotnet client.
A single MutateGoogleAdsRequest contains 1000 AdGroupAdOperations like this:
`{
"customerId": "12345",
"mutateOperations": [
{
"adGroupAdOperation": {
"create": {
"status": "ENABLED",
"ad": {
"responsiveSearchAd": {
"headlines": [
{
"text": "XXXXXX"
},
.
.
.
{
"text": "YYYYYY"
}
],
"descriptions": [
{
"text": "XXXXXX"
},
.
.
.
{
"text": "ZZZZZZZ"
}
],
"path1": "P1",
"path2": "P2"
},
"finalUrls": [
"
https://samplewebsite.com/xyz"
],
"name": "1923792"
},
"adGroup": "customers/12345/adGroups/CCCCCCCC"
}
}
},
.
.
.
{
"adGroupAdOperation": {
"create": {
"status": "ENABLED",
"ad": {
"responsiveSearchAd": {
"headlines": [
{
"text": "XXXXXX"
},
.
.
.
{
"text": "YYYYYY"
}
],
"descriptions": [
{
"text": "XXXXXX"
},
.
.
.
{
"text": "ZZZZZZZ"
}
],
"path1": "P1",
"path2": "P2"
},
"finalUrls": [
"
https://samplewebsite.com/xyz"
],
"name": "1923786"
},
"adGroup": "customers/12345/adGroups/DDDDDD"
}
}
}
],
"partialFailure": true,
"responseContentType": "MUTABLE_RESOURCE"
}`
Every AdGroupAdOperation is related to unique AdGroup. So I have guarantee AdGroup is not shared across multiple MutateGoogleAdsRequests.AdGroups from AdGroupAdOperations can belong to the same Campaign.
I process multiple MutateGoogleAdsRequests in 2 threads when every thread process one MutateGoogleAdsRequest at time.
After few requests I get errors like this
`{
"errorCode": {
"databaseError": "CONCURRENT_MODIFICATION"
},
"message": "Multiple requests were attempting to modify the same resource at once. Retry the request.",
"location": {
"fieldPathElements": [
{
"fieldName": "mutate_operations",
"index": 0
},
{
"fieldName": "ad_group_ad_operation"
}
]
}
}`
When I process MutateGoogleAdsRequests in 1 thread, a problem dosen't seem to exist.
It seems strange because, as I wrote above, every AdGroupAdOperation is related to unique AdGroup.
What is the cause of error CONCURRENT_MODIFICATION?