1

My Rails Application Uses AWS SDK v3 to invoke lambda functions as follows

        lambda_client = Aws::Lambda::Client.new(client_config)
        lambda_return_value = lambda_client.invoke(
        {
            function_name: function_name,
            invocation_type: 'RequestResponse',
            log_type: 'None',
            payload: generated_payload,
        }

Most of my lambda functions execute successfully, but the ones that take longer than ~60sec result in the following exception on the ruby side even though the lambda executes completely

A Seahorse::Client::NetworkingError occurred in background at 2019-07-11 00:47:18 -0500 :
  Net::ReadTimeout

I have gone through the documentation and cannot find a way to set a longer timeout for my lambda invocation. Any ideas how to get ruby to wait for the invocation and not timeout?

1 Answer 1

5

Hi Aws::Lambda::Client default timeout is 60 but you can change this while creating new client. Set :http_read_timeout in your client_config

client_config = {
....
http_read_timeout: 100
}

then create new client

lambda_client = Aws::Lambda::Client.new(client_config)

For more reference: https://docs.aws.amazon.com/sdkforruby/api/Aws/Lambda/Client.html

I hope that helpful

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.