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

Fix error logging during AWS init #3943

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

itsbjoern
Copy link

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 payload

aws/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.

@itsbjoern
Copy link
Author

Hey @antonpirker, really sorry to ping you like this but just wondering if there is any other action required from me here. Happy to patch this in our own codebase for now, but I'd love to help out where I can to see this fixed upstream.

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.

1 participant