Uploaded image for project: 'AdMaxLocal'
  1. AdMaxLocal
  2. AML-3804

AdMaxJMSListener makes too many calls to the distribution service

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Mercury
    • Fix Version/s: Mercury
    • Labels:
      None
    • Sprint:
      Sprint 13

      Description

      To confirm this bug, tail the /var/log/tomcat6/aml-distribution.log log file (tail -f /var/log/tomcat6/aml-distribution.log) and then do a deployment. Tail the listener log file as well.

      Every time the listener makes a REST call to the distribution service, this line shows up in the listener log:

      2015-11-18 10:10:37.689 (4) [pool-14-thread-1]: Using value null for property sabb.defaultBid.bing.USD of type ALGORITHM
      2015-11-18 10:10:56.995 (4) [P4T1]: Using value 0.8 for property ce.mobileBidModifier of type CONTENT_EDITOR
      

      and this line shows up in aml-distribution.log

      2015-11-18 19:59:23,501-787189525 [http-8081-36] INFO  com.thesearchagency.services.distribution.client.remote.SAPISecurityTokenClient [] - http://localhost:8080/sapi/rest/security/tokens?username=admin%2Btsa%40thesearchagency.com&password=admin&realm=thesearchagency
      

      You will see many new lines show up in the aml-distribution.log (roughly one for each campaign target and adgroup).

      To confirm the fix once the new build is deployed, tail the aml-distribution.log file and the amount of new lines will drop significantly. There is a new line in the listener log file. You should only see that twice per merchant (once for CONTENT_EDITOR, once for ALGORITHM).

      2015-11-18 16:29:52.389 (3) [pool-5-thread-2]: Distribution Properties Cache: Loading new properties for db2e9d61-2136-4d8d-abe1-75dfcaad4f43_CONTENT_EDITOR
      

      developer notes (qa can ignore)

      Every campaign makes a request to the distribution service to get the mobile bid modifier. Every AdGroup makes a request to get the initial bid.

      Campaign:
              Double systemMobileBidModifier = Double.parseDouble(
                      OverridableSystemProperties.getProperty(
                              OverridableSystemProperties.getMerchantIdForAccount(getAccountID(), getDatabasePool()),
                              PropertyType.CONTENT_EDITOR, ContentEditorConst.ContentEditorProperty.MOBILE_BID_MODIFIER.getKey()));
      

      AdGroups:

      BingAccountDeployer.createCampaigns() calls getInitialBid with sabb.defaultBid.bing.USD

      campaignCreateWorker.setInitialBids() calls OverridableSystemProperties with "sabb.defaultBid.bing.USD"
      

      AdGroupChangeRequest.getAdGroups() calls getInitialBid() for every adgroup, which results in an http request to the distribution service for every adgroup. looks for sabb.defaultBid.google.USD

      private CpcBid getInitialBid(AdGroupInfo anAdGroup, String aCurrencyCode)
          {
          	Float defaultBid = null;
          	
          	try {
          		String merchant_id = anAdGroup.getName().split("_")[0];
          		
      	    	AdMaxProperties props = new AdMaxProperties(merchant_id);
      	    	
      	        defaultBid = props.getFloat(AdMaxProperties.SABB_DEFAULT_BID_PROPERTY_PREFIX, 
      	                TSAConst.GOOGLE_DISTRIBUTION_ID, aCurrencyCode);
          	}
          	catch (Exception e) {
          		Debug.msg(Debug.ERROR, "Error retrieving default bid value - " + e.getMessage());
          	}
      
      

      Accounts:

      GoogleAccountChangeRequests looks for the ce.defaultBudget

          	String defaultBudgetProperty = OverridableSystemProperties.getProperty(OverridableSystemProperties.getMerchantIdForAccount(getAccountID(), getDatabasePool()), 
      				PropertyType.CONTENT_EDITOR, "ce.defaultBudget");
      

      Bing might use a properties file, which needs to be changed

      DistributionServiceClient gets created 6 times.

      • GoogleAPISearchEngine.createAPI line 239

        Attachments

          Activity

            People

            • Assignee:
              Madhan Madhan Pulipati [X] (Inactive)
              Reporter:
              therouxj Jeff Theroux
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: