Find your content:

Search form

You are here

Notification from timed-out batch query?

 
Share

I have a batch process where it's intermittently failing due to what looks like the batch query timing out (details are here if you're interested).

The error ends up looking like this in my log.

enter image description here

I would like for me or the org's admin to receive an email notification if this occurs. Currently nothing's being sent by SF, I assume because this is a low-level unhandled exception in SF, and the batch is "Aborted" rather than "Failed".

Furthermore, since it's happening on the query, the execute method is never getting run, so I don't think I can do a try/catch in my batch to catch this error and report it.

How can I provide a notification on this sort of timeout?

Thanks!


Attribution to: mscholtz

Possible Suggestion/Solution #1

Your best option right now would be to run a scheduled class that periodically check your batches (AsyncApexJob) for any jobs that meet that certain type of error message, and send a notification about the failures. You'll want to keep track of which notifications you've already sent out, since you can't simply "delete" the failed operations or affect their status in any way. Any time we see an error with a ORA code is an internal bug that somehow floated past the layers of code designed to catch those errors.


Attribution to: sfdcfox
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/33618

My Block Status

My Block Content