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

Joda-time as required dependency for REST API implementations with AWS Lambda #72

Open
stepio opened this issue Jan 22, 2019 · 2 comments
Labels
events-v4 To be pulled into aws-lambda-java-event v4

Comments

@stepio
Copy link
Contributor

stepio commented Jan 22, 2019

Tried excluding Joda-time from a function's implementation for AWS Lambda and got next error:

java.lang.ClassNotFoundException: org.joda.time.DateTime: lambdainternal.util.ReflectUtil$ReflectException
lambdainternal.util.ReflectUtil$ReflectException: java.lang.ClassNotFoundException: org.joda.time.DateTime
Caused by: java.lang.ClassNotFoundException: org.joda.time.DateTime
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)

This required dependency adds extra 0.5 megabytes to the resulting "fat jar". Extra jar size requires reserving more memory for the function to prevent Metaspace issues. But Joda-time itself is not of much use while using Java 8 (and earlier Java versions are not supported in AWS Lambda anyway), so this limitation is unnecessary.

Maybe it's time to get rid of Joda-time? At least in some "next gen" version, for example?

P.S.: Maybe it's a duplicate of #35 , but I just wanted to bring extra reasons to your attention.

@JohannesBe
Copy link

JohannesBe commented Feb 1, 2019

Actually I think this is a HUGE waste of resources: it drastically increases the cold boot time for a lambda, multiply this by thousands of lambda users, with each thousands of lambda requests and the resulting unnecessary overhead is out of your mind (let's be honest here, only 0.5% of users use SNSEvent.java, CodeCommitEvent.java or ScheduledEvent.java in a lambda function).

If the amazon SDK has a dependency on it, then include it in that pom, this should not pollute the events package in ANY way.

stepio added a commit to stepio/aws-lambda-java-libs that referenced this issue Feb 3, 2019
stepio added a commit to stepio/aws-lambda-java-libs that referenced this issue Feb 3, 2019
stepio added a commit to stepio/aws-lambda-java-libs that referenced this issue Feb 3, 2019
@msailes msailes added the events-v4 To be pulled into aws-lambda-java-event v4 label Nov 25, 2021
@msailes
Copy link
Collaborator

msailes commented Jan 7, 2022

Joda time will be removed in the next major version release (v4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
events-v4 To be pulled into aws-lambda-java-event v4
Projects
None yet
Development

No branches or pull requests

3 participants