Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-10166

Throttling timeout wrong between geocoding requests.

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.1.2
    • Fix Version/s: 4.2.0
    • Component/s: Core CiviCRM
    • Labels:

      Description

      From IRC:

      18:17 < Yaroon> More about geocoding...
      18:17 < Yaroon> throttle=0 (1 to add a 5 second sleep between each geocoding request)
      18:17 < Yaroon> (is what the doc says)
      18:17 < Yaroon> if ( $this->throttle )

      { 18:17 < Yaroon> usleep( 50000 ); 18:17 < Yaroon> }

      18:17 < Yaroon> usleep takes an argument in microseconds...
      18:17 < Yaroon> 1000000 would be 1 second
      18:18 < Yaroon> 50000 is not going to be 5 seconds.
      18:23 < Yaroon> What that means is that you hit Google's servers super fast (with the current code) even if you throttle...
      18:23 < Yaroon> And Google will be like: WTF? And give you a "OVER_QUERY_LIMIT" response after 11 requests.
      18:25 < Yaroon> So when the cron runs and you've got 11 bad addresses in a row without geocodes... it'll not geocode them (cuz something's wrong) and you'll get the OVER_QUERY_LIMIT and the script stops.
      18:26 < Yaroon> Next time it runs it'll start with the 11 bad ones again as they don't have geocodes, but CiviCRM bombs the server and will get the OVER_QUERY_LIMIT. It's stuck forever.

      Solution:

      In CRM/Utils/Addresses/BatchUpdate.php ->

      if ( $this->throttle )

      { usleep( 5000000 ); }

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              jeroen Jeroen Bensch
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: