Callout Timeout Applicability In Batch Apex Execute
0 reputation · 24 Jun 2022, 06:26 UTC
Investigate whether HttpRequest.setTimeout values set before a callout are enforced as hard limits when the callout originates from a batch job's execute method, given that batch execution operates under CPU time constraints and lacks a language-level cancellation mechanism.
Establish how the Salesforce platform reconciles callout-level timeouts with request-level SOQL and DML timeout boundaries, particularly when batch jobs interleave long-running operations with asynchronous sendouts, and whether any documented fallback or exception path exists for timeout violations.
What timeout value does the platform apply as the effective limit for a callout initiated from batch execute() if HttpRequest.setTimeout is set to a specific millisecond count? Does the platform impose an independent request timeout that supersedes the configured value, and under what circumstances does System.CalloutException surface versus System.QueryException? How does the absence of a cancellation token influence error handling for long-running batch processes that must abort pending callouts?