Skip to content

bug: EventBridge PutEvents call with a payload of 40KB crashes LocalStack #12390

@ffeytons

Description

@ffeytons

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When sending a payload of >= 40KB in the LocalStack EventBridge using the PutEvents API, the LocalStack Docker container increases its consumption of RAM by multiple GB and ends up being killed by the Docker Desktop engine.
Tried with OrbStack (alternative to Docker Desktop), similar issue: the container increases its consumption of RAM by multiple GB and OrbStack indicates in the end that the "python" process has been killed. At that moment, LocalStack outputs the following log: LocalStack supervisor: localstack process (PID 13) returned with exit code -9

Sending a much smaller payload (e.g. 2-3KB) works fine.

I did not test with in-between sizes for the payload, so it might be that the minimum to crash LocalStack is lower than 40KB.

To be noted:

  • I did not have this behaviour with the previous major version of LocalStack (v3.x)
  • I tried with LOCALSTACK_PROVIDER_OVERRIDE_EVENTS=legacy --> same result
  • I tried with LOCALSTACK_PROVIDER_OVERRIDE_EVENTS=v1 --> same result

Expected Behavior

LocalStack EventBridge is hable to handle a payload of up to 256KB (the limit of AWS EventBridge)

How are you starting LocalStack?

With the localstack script

Steps To Reproduce

How are you starting localstack (e.g., bin/localstack command, arguments, or docker-compose.yml)

localstack start -d

Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

// Multiple services written in Node.js and PHP, they all have the same issue

// Node.js - AWS SDK
await eventBridgeClient.send(new PutEventsCommand(event));

// PHP - AWS SDK 
$this->eventBridgeClient->putEvents([
        'Entries' => ...
    ]);

Steps to reproduce

  1. Send an EventBridge message with the PutEvents API, and include in the Detail object of the Entries a payload >= 40KB
  2. The API call to LocalStack times out after some moment (PHP client error: Error executing "PutEvents" on "http://host.docker.internal:4566"; AWS HTTP error: cURL error 52: Empty reply from server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://host.docker.internal:4566)
  3. The message is never processed by the LocalStack EventBridge
  4. Afterwards, any call to PutEvents returns an empty response immediately --> LocalStack must be restarted

Environment

- OS: macOS 14.6.1
- Hardware: M1 Pro, 32GB RAM -- Docker has access to 16GB RAM
- Docker Engine: Docker Desktop and OrbStack (tried both), latest versions as of writing these lines
- LocalStack:
  LocalStack version: 4.2.1.dev51
  LocalStack Docker image sha: sha256:6fdc4a79b05871a836c8c3a112d1368cb51d6e7b7aef9617c3023214d18b9283
  LocalStack build date: 2025-03-14
  LocalStack build git hash: 339c073d0

Anything else?

No response

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions