SWA fails to call slow API
- Dominant language
- No language data
- Stars
- 346
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
I have a SWA built using Angular that is linked to a BYO Function App. The Function App links to a Serverless Azure SQL Database.
The system works fine until the SQL Database falls asleep. When this happens, the function encounters errors while it wakes SQL up. The function is configured with a long SQL Connection Timeout (180 seconds). It also uses EFCore with resilient connections (default configuration provides 6 retries). The combination of SQL Connection Timeout and EFCroe resiliency works well outside of the SWA environment - the function automatically retries, per configuration and ultimately succeeds in getting data from SQL after waking it up.
However, the same is not true when the function is linked to SWA and invoked from the client. The client appears to receive an HTTP 500 error after about 30 seconds. However, when viewing the log stream of the function app, it appears to continue running and completes its job - even after the client fails with the 500. It appears as if there is some sort of load balancer/proxy in between the SWA and BYO function that has set a timeout value of about 30 seconds. Is this true? Is there a way to adjust this timeout?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.