Skip to content

Commit 0f6c32a

Browse files
committed
fix: separate durable async invoke flow
1 parent dea7e5c commit 0f6c32a

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

samcli/local/lambda_service/local_lambda_http_service.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,10 @@ def _invoke_request_handler(self, function_name):
274274
"function": function,
275275
}
276276

277-
if invocation_type == EVENT:
277+
is_durable = function is not None and function.durable_config is not None
278+
279+
# Non-durable EVENT invocations run fully async
280+
if invocation_type == EVENT and not is_durable:
278281
self.executor.submit(self._invoke_async_lambda, **arguments)
279282
return self.service_response("", headers, 202)
280283
try:
@@ -295,6 +298,10 @@ def _invoke_request_handler(self, function_name):
295298
if invoke_headers and isinstance(invoke_headers, dict):
296299
headers.update(invoke_headers)
297300

301+
# Durable EVENT invocations return 202 with execution ARN header but empty body
302+
if is_durable and invocation_type == EVENT:
303+
return self.service_response("", headers, 202)
304+
298305
if is_lambda_user_error_response:
299306
headers["x-amz-function-error"] = "Unhandled"
300307

0 commit comments

Comments
 (0)