You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6014ceb
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/commands/watch.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -275,6 +275,24 @@ The following video shows you how to use the watch subcommand with Lambda extens
275
275
276
276
<iframewidth="560"height="315"src="https://www.youtube.com/embed/z2sv41ukHTE"title="YouTube video player"frameborder="0"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"allowfullscreen></iframe>
277
277
278
+
## Graceful shutdown support
279
+
280
+
The watch subcommand will propagate `SIGTERM` and `SIGINT` signals to your function, with a delay to allow for graceful shutdown logic to fire.
281
+
282
+
This makes a best-effort attempt to replicate signal handling in AWS Lambda, including allowed shutdown delay, but does not strictly match AWS orchestration. Note that graceful shutdown is only enabled in AWS if extensions are registered. This means that if your function has no registered extensions, it will only receive a `SIGKILL`.
283
+
284
+
One easy way to trigger a graceful shutdown in a Posix shell is by using `Control-C` in the session
285
+
running your `cargo lambda watch` process.
286
+
287
+
Some caveats:
288
+
- Graceful shutdown signals are only propagated to the function's process, not that of external extensions.
289
+
- Graceful shutdown signals are not sent properly on hot reload, only direct signaling to the `cargo watch` process.
290
+
- No guarantees are made around sequencing of runtime shutdown and extensions receiving `SHUTDOWN` events.
291
+
292
+
For more information on graceful shutdown handling, refer to:
0 commit comments