Why do I see "CPU Timeout" errors when Connect writes changes to Salesforce?

Issue

Several changes are made to your data in your Heroku PostgreSQL database that Heroku Connect then tries to synchronize to Salesforce in batches. Upon synchronizing these changes, Salesforce returns a "CPU Timeout" error.

Resolution

This may be happening because your Salesforce organization has some expensive Apex triggers configured. These can be a problem when too many changes are synchronized at once. In cases where the trigger runs for too long, Salesforce will timeout, cancelling its execution. This causes Heroku Connect to mark those writes as failed.

The most effective short-term solution to this is to retry the failed writes to Salesforce in smaller numbers to determine how many may succeed at one time. This will allow you to continue to retry all remaining failed writes at the aforementioned retry rate until none remain. This will, however, impact write performance to Salesforce.

For a longer-term solution, it may also be good to re-evaluate the efficiency of your Salesforce organization's Apex triggers as well as how necessary they actually are.

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support