Skip to main content
Added new case #
Source Link
Robert Watson
  • 2.2k
  • 20
  • 24

Can anybody else replicate this issue, and/or explain to me what's going on? And yes, this may seem more suited for a case, but Salesforce closed my case (#15549753twice - #15549753 & #16942751) because developer support is not offered to non-premier partners.

Can anybody else replicate this issue, and/or explain to me what's going on? And yes, this may seem more suited for a case, but Salesforce closed my case (#15549753) because developer support is not offered to non-premier partners.

Can anybody else replicate this issue, and/or explain to me what's going on? And yes, this may seem more suited for a case, but Salesforce closed my case (twice - #15549753 & #16942751) because developer support is not offered to non-premier partners.

Re-tested and it's *still* not fixed
Source Link
Robert Watson
  • 2.2k
  • 20
  • 24

Update: This issue seems to still reproduce in Summer '17 sandboxes, so it is still not fixed as of 57/1513/17.

Update: This issue seems to still reproduce in Summer '17 sandboxes, so it is still not fixed as of 5/15/17.

Update: This issue seems to still reproduce in Summer '17 sandboxes, so it is still not fixed as of 7/13/17.

Update with Summer '17 testing results; increased loop to 1000 because 500 wasn't causing a CPU timeout for me anymore
Source Link
Robert Watson
  • 2.2k
  • 20
  • 24
public class TestCpuTimeout implements Database.Batchable<sObject> {
    public Database.QueryLocator start(Database.BatchableContext bc) {
        return Database.getQueryLocator('SELECT Id FROM Account LIMIT 200');
    }

    public void execute(Database.BatchableContext bc, List<sObject> scope) {
        scope[0].put('NumberOfEmployees', 100);
        update scope[0];
        System.debug('Account updated: ' + scope[0].Id);
    
        List<String> largeData = new List<String>();
        for (Integer i = 0; i< 10000; i++) largeData.add('Test');
        for (Integer i = 0; i < 500;1000; i++) {
            // Not calling Limits.getCpuTime() seems to cause this batch job to silently fail.
            // When there is a silent failure, any record updates do not get rolled back.
            //System.debug(Limits.getCpuTime()); // This causes a CPU timeout.
            //long l = Limits.getCpuTime(); // This causes a CPU timeout.
            //System.debug('test'); // This does not cause a CPU timeout. This silently aborts. Record updates are not rolled back.
            String data = JSON.serialize(largeData);
        }
    }

    public void finish(Database.BatchableContext bc) { }
}

This may be related to this Known Issue, but if so, this issue has gone unfixed for over three months.

Update: This issue seems to still reproduce in Summer '17 sandboxes, so it is still not fixed as of 5/15/17.

public class TestCpuTimeout implements Database.Batchable<sObject> {
    public Database.QueryLocator start(Database.BatchableContext bc) {
        return Database.getQueryLocator('SELECT Id FROM Account LIMIT 200');
    }

    public void execute(Database.BatchableContext bc, List<sObject> scope) {
        scope[0].put('NumberOfEmployees', 100);
        update scope[0];
        System.debug('Account updated: ' + scope[0].Id);
    
        List<String> largeData = new List<String>();
        for (Integer i = 0; i< 10000; i++) largeData.add('Test');
        for (Integer i = 0; i < 500; i++) {
            // Not calling Limits.getCpuTime() seems to cause this batch job to silently fail.
            // When there is a silent failure, any record updates do not get rolled back.
            //System.debug(Limits.getCpuTime()); // This causes a CPU timeout.
            //long l = Limits.getCpuTime(); // This causes a CPU timeout.
            //System.debug('test'); // This does not cause a CPU timeout. This silently aborts. Record updates are not rolled back.
            String data = JSON.serialize(largeData);
        }
    }

    public void finish(Database.BatchableContext bc) { }
}

This may be related to this Known Issue, but if so, this issue has gone unfixed for over three months.

public class TestCpuTimeout implements Database.Batchable<sObject> {
    public Database.QueryLocator start(Database.BatchableContext bc) {
        return Database.getQueryLocator('SELECT Id FROM Account LIMIT 200');
    }

    public void execute(Database.BatchableContext bc, List<sObject> scope) {
        scope[0].put('NumberOfEmployees', 100);
        update scope[0];
        System.debug('Account updated: ' + scope[0].Id);
    
        List<String> largeData = new List<String>();
        for (Integer i = 0; i< 10000; i++) largeData.add('Test');
        for (Integer i = 0; i < 1000; i++) {
            // Not calling Limits.getCpuTime() seems to cause this batch job to silently fail.
            // When there is a silent failure, any record updates do not get rolled back.
            //System.debug(Limits.getCpuTime()); // This causes a CPU timeout.
            //long l = Limits.getCpuTime(); // This causes a CPU timeout.
            //System.debug('test'); // This does not cause a CPU timeout. This silently aborts. Record updates are not rolled back.
            String data = JSON.serialize(largeData);
        }
    }

    public void finish(Database.BatchableContext bc) { }
}

This may be related to this Known Issue, but if so, this issue has gone unfixed for over three months.

Update: This issue seems to still reproduce in Summer '17 sandboxes, so it is still not fixed as of 5/15/17.

Tweeted twitter.com/StackSalesforce/status/823033611293224961
added 26 characters in body
Source Link
Adrian Larson
  • 151.3k
  • 38
  • 247
  • 431
Loading
edited tags
Link
Adrian Larson
  • 151.3k
  • 38
  • 247
  • 431
Loading
Source Link
Robert Watson
  • 2.2k
  • 20
  • 24
Loading