hey all. what on earth does this error mean? ```d6...
# help
s
hey all. what on earth does this error mean?
Copy code
d600c023-bcd1-4f30-99a9-bc75cd41b512-1631131594863 Failed to send response because the Lambda function is disconnected
full log:
Copy code
d600c023-bcd1-4f30-99a9-bc75cd41b512 REQUEST dev-microservices-api-public-createUser [src/lambda/rest/functions/create-user.main] invoked by API POST /users
d600c023-bcd1-4f30-99a9-bc75cd41b512 RESPONSE {"statusCode":201}
d600c023-bcd1-4f30-99a9-bc75cd41b512-1631131594863 Failed to send response because the Lambda function is disconnected
f
It happens when the AWS Lambda function timedout already when sst start sent the response back
s
huh.. so. ah! ok, I know why
the Aurora Serverless DB wasn’t spun up. so Lambdas will always time out
thanks for the help 🙂
f
hmm sst start sets a timer on each request with a timeout same as thr Lambda functions's timeout. And ur local function should gets killed when the timeout is reached.
You shouldve seen a timeout error locally as well... 🤔
s
yeah, no timeout error. just the one I pasted
f
Hmm what was the lamda's timeout set to?
s
10 seconds I think
I leave it at default, unless it’s doing media processing or any kind of long-running process. then I go for 5-10 minutes
f
i see. and how long did the function run for locally before you got the 201 response?
roughly 10s maybe?
s
not sure, this came from my dev
I’ll keep an eye out for it next time
f
yup yup
r
We've found Aurora startup times to be really long, often over a minute. v2 is supposed to be much faster but it's been in preview for 46 years. Consequently we've decided to migrate everything to DDB (also should save us money with associated VPC, NAT GW and the cost of Aurora)
s
I would’ve used DDB but it just wasn’t a good fit. we need to be able to arbitrarily sort on any column, ascending & descending. our data is very tabular
r
yeah, certainly doesn't fit everywhere. I think if we were doing it again we'd look outside of AWS for a SQL based option
t
Aurora v1 serverless IMO is not viable, I think it's better to just pay for a 24/7 normal cluster
Highly recommend planetscale if you need serverless sql
s
Aurora Serverless is ok, you just can't use the auto pause feature in production. I'm using it in dev only to save $
t
yeah makes sense in dev
r
Because of our usage patterns we could make it work but needed to build in a wake-up lambda running on a cron