mirror of
https://github.com/swift-server/swift-aws-lambda-runtime.git
synced 2026-05-03 07:22:27 +00:00
This PR implements a mechanism to propagate connection loss information from the Lambda runtime client to the runtime loop, enabling termination without backtrace when the connection to the Lambda control plane (or a Mock Server) is lost. The changes are: - When the connection is lost, `ChannelHandlerDelegate.channelInnactive()` now correctly calls `resume(throwing:)` on the ending continuation, for all states (`.waitingForNextInvocation ` and `.sentResponse`). This eliminates the hangs on connection lost.. - I added top-level error handling on `LambdaRuntime._run()` - Add a unit test to check that either `LambdaruntimeError.connectionToControlPlaneLost`, a `ChannelError`, or an `IOError` is thrown when the server closes the connection
This commit is contained in:
committed by
GitHub
parent
323b3f2ac2
commit
efc4cd16bf
@@ -216,7 +216,7 @@ struct HttpServer {
|
||||
} else if requestHead.uri.hasSuffix("/response") {
|
||||
responseStatus = .accepted
|
||||
} else if requestHead.uri.hasSuffix("/error") {
|
||||
responseStatus = .ok
|
||||
responseStatus = .accepted
|
||||
} else {
|
||||
responseStatus = .notFound
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user