Support required for implementing a long-running function to resolve function timeout issues

Hi,

We are currently working on a feature where the function involves heavy and long-running operations. As a result, the execution time exceeds 25 seconds, causing a function execution timeout issue.

So we are switching the function to Long-running function,However, during the implementation of the long-running function, we are encountering the following issue:

  • When running forge deploy
Error: Manifest validation failed: Timeout too long for function capacityResolver. Maximum timeout  25 seconds. (requestId: 8a05d1c8-f49a-417e-889b-3471bbcfd177).

I have attached the Resolver and Consumer modules for reference. let me know if it is correct or if any changes are required.




Hi @KiranVinayagam,

The syntax for defining a queue consumer in the manifest was recently updated. I suspect this may be related?

Instead of resolver property in your consumer module, you now can just define a function directly, like so:

consumer:
  - key: queue-consumer
    # Name of the queue for which this consumer will be invoked
    queue: queue-name
    # Function to be called with payload
    function: consumer-function

function:
  - key: consumer-function
    handler: consumer.handler
    timeoutSeconds: 600

Do you want to try updating to the new manifest syntax (and updating your consumer to be a regular function rather than a resolver) and seeing if that helps?

cheers,
Tim

In addition to Tim’s advice, also double-check to make sure the function is not referenced by any other modules. If a function is used as a queue consumer and also as the implementation for another module (eg. an event handler), the lowest maximum timeout wins (eg. 25 seconds).

1 Like

Hi,

The issue has been resolved as function was referenced by other module.

Thanks for the solution.

cheers,
Kiran