Functions Apex Callbacks not occurring when an org is hitting Salesforce API Concurrency Limits
Last updated 2022-02-10 ·Reference W-9961351 ·Reported By 0 users
Summary
Some customers may experience that async Function invocations never receive an Apex callback when the API of the invoking org is at its concurrency limit. This also means that the status of the FunctionInvocationRequest object is never updated.
Function callbacks and updates to the FunctionInvocationRequest object are delivered through the API of the invoking org. To protect the health of the Salesforce service there’s a limit on the maximum number of concurrent, long-running API transaction requests per org. When that limit is reached, all subsequent API requests (including Function callbacks) will fail, preventing the FunctionInvocationRequest object from being updated.
A long-running API request is one that takes more than 20 seconds to complete. See the documentation for details on limits on concurrent long-running API requests (https://developer.salesforce.com/docs/atlas.en-us.232.0.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_api.htm).
Repro
1. Deploy a Salesforce Function and deploy Apex code to invoke it asynchronously
2. Generate long-running API request load on your org to bring the org over the concurrent long-running API request of 25
3. Invoke the async function
4. Observe that the org never receives the callback, even though the function invocation completed successfully and that a “(API callback; failed to make API call)” message is logged in the function log
Workaround
1. Try to reduce the overall number of long-running API requests (whether from Functions or from other sources) handled by your org to ensure that headroom is always available for Function callbacks
2. Log a support ticket to increase the concurrent API limit (please refer to this known issue in your ticket)
Reported By (0)
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.