I was trying to debug why my Lambdas triggered by ...
# sst
s
I was trying to debug why my Lambdas triggered by EventBridge rules are not being retried for function errors on local dev and found this on the code that
retryAttempts
is hard set to `0`: https://github.com/serverless-stack/serverless-stack/blob/9cf405643a2172e243f3120db4ba837563623135/packages/resources/src/Function.ts#L674. I saw the note on why it’s set to zero, and I'm not sure if I've ran into the same issue with Cron, but I was wondering if it can be allowed to be override if we do pass the
retryAttempts
prop explicitly instead of hard set to zero on local dev. I would like a consistent behavior on local dev and deployed when error is thrown, to be retried. It would probably be worth noting it on doc that the default is set to
0
instead of the AWS's default of
2
to avoid confusion like I just went through.
f
Hey @Sione, yeah we should document this better. Btw can you share your use case for retry?
The thinking is that when live debugging, you’d probably want to fix something before auto-retrying.
s
Oh I see, ya I think that's a sensible default. My background lambdas mostly triggered by Eventbridge are set explicitly to be retried for resiliency in case of transient errors before being put in a DLQ. More of replicating the retry that comes out of the box for SQS. Since I explicitly set and expect it to retry, I was just confused why it wasn't. For now, I’ve just made a note so my team are aware. I can definitely foresee it as confusing if not documented.
Hence maybe allowing it to be override for those who may know what to expect and for specific use cases.