Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WithEnableSIGTERM option #457

Merged
merged 13 commits into from Jul 28, 2022
Merged

Add WithEnableSIGTERM option #457

merged 13 commits into from Jul 28, 2022

Conversation

bmoffatt
Copy link
Collaborator

Issue #, if available:

#318

Description of changes:

Adds an incomplete internal implementation of the extensions API, and uses it to add an option to opt-in to SIGTERM. This allows function authors to run code on shutdown without also having to attach an extension layer.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov-commenter
Copy link

codecov-commenter commented Jul 25, 2022

Codecov Report

Merging #457 (c96ca23) into main (6796528) will decrease coverage by 3.21%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #457      +/-   ##
==========================================
- Coverage   72.90%   69.69%   -3.22%     
==========================================
  Files          19       20       +1     
  Lines        1085     1201     +116     
==========================================
+ Hits          791      837      +46     
- Misses        225      297      +72     
+ Partials       69       67       -2     
Impacted Files Coverage Δ
lambda/extensions_api_client.go 0.00% <0.00%> (ø)
lambda/handler.go 92.08% <0.00%> (-5.63%) ⬇️
lambda/sigterm.go 0.00% <0.00%> (ø)
lambda/rpc.go
lambda/function.go
lambda/rpc_function.go 79.10% <0.00%> (ø)
events/attributevalue.go 78.46% <0.00%> (+0.20%) ⬆️
lambda/errors.go 87.09% <0.00%> (+9.67%) ⬆️
lambda/entry.go 81.81% <0.00%> (+9.81%) ⬆️
lambda/invoke_loop.go 89.42% <0.00%> (+15.73%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6796528...c96ca23. Read the comment docs.

@bmoffatt bmoffatt changed the title Sigterm Add WithEnableSIGTERM option Jul 25, 2022
@bmoffatt bmoffatt marked this pull request as ready for review July 26, 2022 00:12
@bmoffatt bmoffatt requested a review from carlzogh July 26, 2022 00:12
@@ -25,11 +25,15 @@ jobs:

- run: go version

- name: install lambda runtime interface emulator
run: curl -L -o /usr/local/bin/aws-lambda-rie https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/download/v1.6/aws-lambda-rie-x86_64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change v1.6 to latest in order to always test against the most recent release - eg. URL from RIE readme:

https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie-x86_64

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ curl -L https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/download/latest/aws-lambda-rie-x86_64
Not Found

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

@bmoffatt bmoffatt Jul 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it seems to be a different url ordering for latest

blahblah/latest/download/

Not

blahblah/download/latest/

🤷‍♂️

lambda/handler.go Show resolved Hide resolved
lambda/sigterm.go Show resolved Hide resolved
carlzogh
carlzogh previously approved these changes Jul 27, 2022
@bmoffatt bmoffatt merged commit 93199f7 into aws:main Jul 28, 2022
@bmoffatt bmoffatt deleted the sigterm branch July 28, 2022 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants