Ministack: Free, open-source local AWS emulator - 60+ services, Terraform compatible, real databases. Free forever. MIT licensed.
Python awsaws-emulatoraws-localaws-sdkdevtoolsdockerdynamodbec2emulatorlambdalocalstacklocalstack-alternativeministackmock-awsopen-sourcepythons3sqsterraform
fix: suppress noisy Lambda BrokenPipeError and RDS Data API import warning spam (#311)
Jay Janssen6aa4f6204e65
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 18548963..2629902b 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -9,6 +9,9 @@ Versioning follows [Semantic Versioning](https://semver.org/).## [Unreleased]+### Fixed+- **Lambda Runtime API noise** — suppressed `BrokenPipeError` tracebacks from Lambda binaries disconnecting after reading the event. This is benign and expected behavior during native `provided` runtime execution.+- **RDS Data API warning spam** — the `pymysql` import warning is now logged once per process instead of on every `ExecuteStatement` call.### Added- **SFN Wait state scaling** — new `SFN_WAIT_SCALE` environment variable (default `1.0`) scales Wait state durations and retry interval sleeps. Set to `0` to skip all waits for fast-forward execution in test scenarios where emulated resources are immediately available. Contributed by @jayjanssen@@ -21,7 +24,6 @@ Versioning follows [Semantic Versioning](https://semver.org/).- **RDS DbiResourceId lookup** — `DescribeDBInstances` and other instance actions now accept `DbiResourceId` (e.g. `db-1AD581BD3647411AACBF`) in addition to the friendly `DBInstanceIdentifier`. Fixes Terraform/OpenTofu state refresh failures. Contributed by @alexanderkrum-next (#305)----## [1.2.10] — 2026-04-13### Addeddiff --git a/ministack/services/lambda_svc.py b/ministack/services/lambda_svc.pyindex 9dde3b9a..f567a1b2 100644--- a/ministack/services/lambda_svc.py+++ b/ministack/services/lambda_svc.py@@ -1569,7 +1569,15 @@ def _execute_function_provided(func: dict, event: dict) -> dict:self.end_headers()# Bind to port 0 — OS assigns a free port atomically, no race window- server = socketserver.TCPServer(("127.0.0.1", 0), RuntimeAPIHandler)+ class _QuietTCPServer(socketserver.TCPServer):+ def handle_error(self, request, client_address):+ import sys+ _, exc, _ = sys.exc_info()+ if isinstance(exc, (BrokenPipeError, ConnectionResetError, ConnectionAbortedError)):+ return+ super().handle_error(request, client_address)++ server = _QuietTCPServer(("127.0.0.1", 0), RuntimeAPIHandler)port = server.server_address[1]def _serve():diff --git a/ministack/services/rds_data.py b/ministack/services/rds_data.pyindex 26b3cb19..800a04a9 100644--- a/ministack/services/rds_data.py+++ b/ministack/services/rds_data.py@@ -457,7 +457,9 @@ def _execute_statement(data):except ImportError as e:if own_conn and conn:conn.close()- logger.warning("DB driver not available, using stub: %s", e)+ if not getattr(_execute_statement, "_import_warned", False):+ logger.warning("DB driver not available, using stub: %s", e)+ _execute_statement._import_warned = Truereturn _stub_execute(resource_arn, sql)except Exception as e:if own_conn and conn: