dgraph-lambda
dgraph-lambda copied to clipboard
BREAKING: feat: make lambda pick up the script from the request body
Earlier, dgraph lambda used to use a predefined lambda script from the file. This poses few limitations on how lambda
are handled in multi-tenant environment.
This change makes dgraph-lambda
accept source
field in the request body. This field will contain the required js script, evaluate it at runtime and execute the query.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
<Deleted Comment, Sent as a security vulnerability>
@gja I have been watching this too. I think the direction is good, but maybe a timeout on the script would fix that concern? But still curious what would happen if more than one script was running back to back. Would the second script have to wait on the first, or will the scripts run async? (I understand async still has to wait for a pause in processing script 1 before it can start working on script 2 and then another pause to come back and finish up working on script 1.)
I've sent the security vulnerability over to manish and naman. Very happy to chat with you over email.
On Wed, Jul 28, 2021 at 00:07:05, Anthony Master @.***> wrote:
@gja https://github.com/gja I have been watching this too. I think the direction is good, but maybe a timeout on the script would fix that concern? But still curious what would happen if more than one script was running back to back. Would the second script have to wait on the first, or will the scripts run async? (I understand async still has to wait for a pause in processing script 1 before it can start working on script 2 and then another pause to come back and finish up working on script 1.)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dgraph-io/dgraph-lambda/pull/22#issuecomment-887741064, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIPOT5F3LURLQLIYKZCFDTZ34FDANCNFSM5AHHBHOQ .
Adding a middleware for a timeout in express should solve the problem @NamanJain8 Example - http://expressjs.com/en/resources/middleware/timeout.html
Note - This will give back the control to the server but you still need to close the VM, it will continue to use the resources.
Fortunately there is a timeout option is available in the vm
package that should do the job
For namespace specific tenant logging- you extend console
object or use proxy
This PR has been stale for 60 days and will be closed automatically in 7 days. Comment to keep it open.