Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi I noticed that the AWS integration fails to capture errors during the init phase (at least in python 3.8 and above environments).
It appears tests for this were disabled after a change in AWS' own runtime environment: #3592
I was able to hunt down a change from a few months ago where it seems like string serialisation of the json payload was disabled and instead the
post_init_error
is invoked directly with the json payloadaws/aws-lambda-python-runtime-interface-client@a37a43a#diff-4513a869520b19ae4e30058106d7c3b5ddbb79216b5e9bd922d83389fb86c603R483
This breaks and causes an error internally when trying to parse the string back into json, and the error is actually swallowed because of
with capture_internal_exceptions():
.I did a bit of trialling in the test suite and it seems like python3.8 still is invoked with a string, whereas 3.9+ is invoked with JSON. But because I'm not 100% sure on the behaviour I just opted to check the arg type instead. I couldn't find any better documentation on this behaviour than the link above which just seems to be a continuous stream of updates to the main AWS python image.