Skip to content

Conversation

rimutaka
Copy link
Contributor

@rimutaka rimutaka commented Mar 21, 2021

Closes #260

Description of changes:

  1. Initialize the value for Context::env_config which was declared in master many commits ago, but was never set to anything
  2. Add #[derive(Serialize, Deserialize)] to Context and Config structs
  3. Mock env vars for successful_end_to_end_run test function
  4. Add more verbose error logging for Config::from_env
  5. Bumped the version to 0.3.1

This change enables proxy-ing lambda requests via transports like AWS SQS for local debugging.
Adding Ser/Deser does not affect the binary size unless those features actually used, so there is no point making it an optional feature.

Backward compatibility: full

See issue #260 for background discussion and https://github.com/rimutaka/lambda-debug-proxy for a proxy example using this feature.

By submitting this pull request

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I confirm that I've made a best effort attempt to update all relevant documentation.

@rimutaka rimutaka marked this pull request as ready for review March 22, 2021 00:11
@dspatoulas
Copy link

We are having a similar issue using the v0.3.0 version of the runtime in a local or non AWS lambda environment. I can confirm without these changes (or setting the environment variables in docker-compose), when running the aws-lambda-rust-runtime in the official AWS Lambda container image (public.ecr.aws/lambda/provided:al2) using the examples in the repo causes the runtime to panic.

We planned to open a similar merge request in the near future, but will hold off until the maintainers have a chance to respond to this MR.

Copy link
Contributor

@bahildebrand bahildebrand left a comment

Choose a reason for hiding this comment

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

Overall this looks good. I think we might want to add some automated tests to prevent a regression like this in the future. I'll open an issue and look into it.

Copy link
Contributor

@bahildebrand bahildebrand left a comment

Choose a reason for hiding this comment

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

LGTM

@bahildebrand bahildebrand merged commit c01811a into awslabs:master Mar 28, 2021
@bahildebrand bahildebrand mentioned this pull request Apr 9, 2021
khuey referenced this pull request Aug 5, 2021
* reorg

* Replace `genawaiter` with `async-stream` (#240)

* don't depend on serde_derive directly

* Add Cargo.lock to gitignore; whoops.

* Cleanup docs; handle panics in lambda functions correctly.

* Create a reusable runtime struct + builder

* Log handler errors in runtime. Issue #241

* Added basic.rs example, comments to other examples

* Tidied up examples readme.

* Fixed headers in examples readme.

* Formatting fix in error-handling.rs.

* Fixed comment in lib.rs

* Corrected handler_fn interface misconception in basic.rs

Co-authored-by: Veetaha <[email protected]>

* Upper-cased and edited examples/readme.md

* Add log and tracing examples; fix `tracing` dependency features.

* disable time on `tracing_subscriber`

* Removed unused refs from basic.rs

* Added error handling for #241, interim, broken.

* Added err logging to lib.rs, consolidated examples

* Log panic as Debug+Display, improved examples

* client.rs formatting fix

* Fixed "Process exited" error in lib.rs.

* Added some tracing!() to lib.rs.

* Enforced Send+Sync for http Handler impl.

* Added docs and missing _vars to reduce warnings

* Removed unnecessary + Sync on handler's future

* All tests passing

* Remove deprecated simple_logger calls

* Remove Cargo.lock

* cargo fmt changes

Co-authored-by: David Barsky <[email protected]>
Co-authored-by: Lucio Franco <[email protected]>
Co-authored-by: Ubuntu <[email protected]>
Co-authored-by: rimutaka <[email protected]>
Co-authored-by: Veetaha <[email protected]>
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.

Serialize/deserialize Context

3 participants