- Newest
- Most votes
- Most comments
Hello.
Execution environments may be reused when the same Lambda is used continuously.
As a result, I think there may be resource contention or something like that.
https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtime-environment.html#runtimes-lifecycle
Are there any other detailed error logs output?
Although it is difficult to determine without looking at detailed logs, an error may occur if there is a conflict between HTTP connections.
Why not try explicitly closing the HTTP connection with "con.close()"?
I thought that closing the HTTP connection at the end of processing would reduce the possibility of resource contention even if the environment was reused.
I appreciate the quick response. No there isn't much detail to the logging. Yes, I had explicit close before putting in the except. I was hoping to get more detail printing the exception, still trying to figure out how to get debug level logs.
My best guess was the <botocore.response.StreamingBody> resource. So, I tried reading the stream into memory ~200MB ("ts" media archive file), close the StreamBody and post the Byte array, but got the same thing.
That led me to believe it was the client not handling the stream, the stream pointer issue, need to chunk the reading of the stream so I tried to use the more current requests and urllib3 clients, but they are not available and I don't want to go through the layer process to find out that is not the issue. I would rather convert from Python to Java to see if I can get information on what the "Device" is referring to. That an I am a once in a few years Python coder so I am not overly familiar with the Python libraries.
I ruled out a network issue since I have another java microservice posting JSON to the same gateway and I didn't get an http error.
I just thought it would be a common easy thing to read s3 object and post using Python.
Basically it came down to the client post. I have abandoned the Python version and created a Spring Function "Function<S3Event, Void>" that successfully posted the video TS file without reading the stream into memory.
Relevant content
- AWS OFFICIALUpdated 20 days ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
You have a lot in that try clause - what happens after the first get_object call - when you print the response
print(s3_response)
Would be nice to know what bits of the code is working and what is failing?