Skip to content

A lot of Init<SignalException> are being raised after upgrading lambda to ruby 3.3 native runtime #35

Open
@wildodecisiv

Description

@wildodecisiv

Recently we have upgraded many or our lambda functions from ruby3.2 to ruby3.3 and we started seeing a lot of this SIGTERM exception

2024-10-04T10:05:14.769-04:00
Init error when loading handler
2024-10-04T10:05:14.769-04:00
{
    "errorMessage": "SIGTERM",
    "errorType": "Init<SignalException>",
    "stackTrace": [
        "/var/lang/lib/ruby/3.3.0/net/protocol.rb:229:in `wait_readable'",
        "/var/lang/lib/ruby/3.3.0/net/protocol.rb:229:in `rbuf_fill'",
        "/var/lang/lib/ruby/3.3.0/net/protocol.rb:199:in `readuntil'",
        "/var/lang/lib/ruby/3.3.0/net/protocol.rb:209:in `readline'",
        "/var/lang/lib/ruby/3.3.0/net/http/response.rb:158:in `read_status_line'",
        "/var/lang/lib/ruby/3.3.0/net/http/response.rb:147:in `read_new'",
        "/var/lang/lib/ruby/3.3.0/net/http.rb:2342:in `block in transport_request'",
        "/var/lang/lib/ruby/3.3.0/net/http.rb:2333:in `catch'",
        "/var/lang/lib/ruby/3.3.0/net/http.rb:2333:in `transport_request'",
        "/var/lang/lib/ruby/3.3.0/net/http.rb:2306:in `request'",
        "/var/lang/lib/ruby/3.3.0/net/http.rb:1917:in `get'",
        "/var/runtime/gems/aws_lambda_ric-3.0.0/lib/aws_lambda_ric/lambda_server.rb:28:in `block in next_invocation'",
        "/var/lang/lib/ruby/3.3.0/net/http.rb:1570:in `start'",
        "/var/runtime/gems/aws_lambda_ric-3.0.0/lib/aws_lambda_ric/lambda_server.rb:27:in `next_invocation'",
        "/var/runtime/gems/aws_lambda_ric-3.0.0/lib/aws_lambda_ric.rb:71:in `wait_for_invocation'",
        "/var/runtime/gems/aws_lambda_ric-3.0.0/lib/aws_lambda_ric.rb:65:in `start_runtime_loop'",
        "/var/runtime/gems/aws_lambda_ric-3.0.0/lib/aws_lambda_ric.rb:49:in `run'",
        "/var/runtime/gems/aws_lambda_ric-3.0.0/lib/aws_lambda_ric.rb:221:in `bootstrap_handler'",
        "/var/runtime/gems/aws_lambda_ric-3.0.0/lib/aws_lambda_ric.rb:203:in `start'",
        "/var/runtime/index.rb:4:in `<main>'"
    ]
}

The lambdas are being deployed using aws sam and they are definied in the template.yaml as follow

Globals:
  Function:
    Architectures:
      - arm64
    Layers:
      - !Ref CommonLayer
    MemorySize: 256
    Runtime: ruby3.3
    Tracing: Active
    Timeout: 15
    
CommonLayer:
  Type: AWS::Serverless::LayerVersion
  Properties:
    LayerName: common
    Description: Layer to share code and dependencies
    ContentUri: app/layers/common/common.zip
    CompatibleRuntimes:
      - ruby3.3
    RetentionPolicy: Delete
    CompatibleArchitectures:
      - arm64
      
 # and below the normal handler path

Have you experienced the same issue?
Do you know what could cause this exception to be raised by the lambda service?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions