spring-projects / spring-boot

Spring Boot helps you to create Spring-powered, production-grade applications and services with absolute minimum fuss.
https://spring.io/projects/spring-boot
Apache License 2.0
75.31k stars 40.71k forks source link

when exception is thrown during init of spring boot app, AWS lambda fails on timeout , instead of immediately by error. #43248

Closed ShaharGlatman closed 16 hours ago

ShaharGlatman commented 16 hours ago

hi, using AWS lambda with spring boot app. in this app exceptions can be thrown during initialization stage (specifically, in @PostConstruct method). i saw that once exception is thrown during this stage, lambda fails on timeout after 15 min, instead of immediately by error. (i had the same issue for exception in the handle function, and this was fixed by upgrading the spring-cloud-function from 3.2.3 to 3.2.4. unfortunately, this doesn't help with exception during initialization). how should i address this issue?

wilkinsona commented 16 hours ago

This is out of Spring Boot's control. A typical Boot app that throws an exception in @PostConstruct will exit immediately. If that's not working in AWS Lambda, that's either a problem in Spring Cloud Function or in AWS Lambda.