Closed rjain07 closed 5 years ago
That's odd it loops. I'm not sure what could be causing that. Have you tried simply exiting manually after it's done. For example:
echo "{"success": true}" >&2
exit 0
}
Also do you think there's anything inside your scripts that could cause that?
I tried exit, quit, etc., without any luck. I also don't have anything that should run scrip in loop. Like I removed everything and ran simple aws s3 copy command inside my handler, but it still loops through.
This is still a mystery to me. I can't reproduce it. What are you setting on your Lambda?
I had regular settings on lambda. In fact I removed everything from handler and just had couple of S3 copy functions. But it was still going in loop and taking full 5 minutes before terminated.
I would say if you are not able to reproduce then please don’t spend much time on this. I have changed my approach little bit and using serverless to deploy my lambda now.
Thanks for looking in to this issue.
-Ritesh
On Aug 6, 2019, at 11:17 PM, Graham Krizek notifications@github.com<mailto:notifications@github.com> wrote:
This is still a mystery to me. I can't reproduce it. What are you setting on your Lambda?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gkrizek/bash-lambda-layer/issues/24?email_source=notifications&email_token=AMBJMUJP37XAWFSJVRFEHYTQDI5FHA5CNFSM4HMTCAQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3XCHVQ#issuecomment-518923222, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMBJMUO3SP7I5JSY5DGMJOTQDI5FHANCNFSM4HMTCAQQ.
Closing this as it's stale and can't reproduce. If we have more details or context we can revisit.
Hello, I enabled layer using the method discussed on this git and am trying to execute bunch of shell scripts (.sh files) that are stored in s3 bucket. I am first copying file from s3 into /tmp folder in Lambda and then trying to execute script using /bin/bash command. I am able to get the results but lambda seems to execute in loop for complete 5 minutes and running command multiple times. That is not the behavior when I use Python Boto3. How do we stop processing and come out once all commands are executed. Following is what my script looks like.
handler () { set -e
aws s3 cp s3://my-bucket/my-folder/download-from-other.sh /tmp/download-from-other.sh aws s3 cp s3://my-bucket/my-folder/upload-to-s3.sh /tmp/upload-to-s3.sh aws s3 cp s3://my-bucket/my-folder/create-emr-stack.sh /tmp/create-emr-stack.sh
cd /tmp ls -l
/bin/bash download-from-other.sh
/bin/bash upload-to-s3.sh /bin/bash create-emr-stack.sh
echo "{"success": true}" >&2
}