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: Do not pass allowCache to java-invoke-local server #1349

Merged

Conversation

AlbertXingZhang
Copy link
Contributor

Description

We were running "java-invoke-local --server" and "serverless offline" as suggested for faster local invocations to the java lambda functions. But every single request we made ended with the following exception.

groovy.lang.MissingPropertyException: No such property: allowCache for class: serverless.jvm.plugin.InvokeRequest

After taking a look at both source codes, I think it is because the java runner sends the unsupported property "allowCache" to the java-invoke-local server accidentally.

Motivation and Context

java-invoke-local doesn't support the property "allowCache".
https://github.com/bytekast/serverless-toolkit/blob/44d94008c5f0e7b6953d7d010f26e0490cd3814a/libs/java-invoke-local/src/main/groovy/serverless/jvm/plugin/InvokeRequest.groovy#L9

But JavaRunner.js sends it as a part of the body data to the java-invoke-local server.

It causes exceptions that prevent us from testing the java lambda functions with faster local invocations. So we made this simple change to just remove "allowCache" from the sending object.

How Has This Been Tested?

We made this change to serverless offline and try it again along with running "java-invoke-local --server" as before. Everything works as expected. We also ran "npm run test:unit" and we don't see it affects any other area.

Screenshots (if appropriate):

image
image

@AlbertXingZhang
Copy link
Contributor Author

Hi @pgrzesik, I'm wondering if anyone could help review this one line change? Thank.🙏

@pgrzesik
Copy link
Collaborator

Hello @AlbertXingZhang - it looks like there are some issues with the change - could you please take a look into the output of CI runs?

@AlbertXingZhang AlbertXingZhang force-pushed the remove-allowCache-from-java-runner branch from dc13d46 to 5050d35 Compare March 16, 2022 17:45
@AlbertXingZhang
Copy link
Contributor Author

Hi @pgrzesik, I have amended the change. Could you please help check if it looks better now? Thanks.

@pgrzesik
Copy link
Collaborator

Hello @AlbertXingZhang - there's some issue with CI builds at the moment - after it will be resolved I will review it again

@pgrzesik
Copy link
Collaborator

Hey @AlbertXingZhang - could you please push your changes again (e.g. by amending the commit and pushing it again)? It seems like it has be to triggered once again or otherwise the CI doesn't start

@AlbertXingZhang AlbertXingZhang force-pushed the remove-allowCache-from-java-runner branch from 73d0fb8 to 178071a Compare March 17, 2022 15:56
@AlbertXingZhang AlbertXingZhang force-pushed the remove-allowCache-from-java-runner branch from 178071a to ef5e02d Compare March 17, 2022 15:57
@AlbertXingZhang
Copy link
Contributor Author

I'm sorry I tried it twice since I'm not sure if it is triggered properly.

@pgrzesik pgrzesik added the bug label Mar 17, 2022
Copy link
Collaborator

@pgrzesik pgrzesik left a comment

Choose a reason for hiding this comment

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

Thank you @AlbertXingZhang 🙇

@pgrzesik pgrzesik changed the title fix: Don't send allowCache to java-invoke-local server fix: Do not pass allowCache to java-invoke-local server Mar 17, 2022
@pgrzesik pgrzesik merged commit c90b8bf into dherault:master Mar 17, 2022
@AlbertXingZhang
Copy link
Contributor Author

Thanks for merging. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants