I have an Azure Function with about 10 timer triggers. Each wakes up, makes a REST GET call to some resource, does some work with it and finishes. The triggers are implemented with nodejs v14 and use axios.
I have set a timeout of 5000 and some of the time it works fine and sometimes it times out (Error: timeout of 5000ms exceeded). I added a retry on failure and the second attempt frequently works. I am pulling data from a bunch of sources including the National Weather Service, NOAA, Google, MLB, NASA and others. The NWS can fail > 20% of the time with a similar success rate on retries.
Given that it works when I run the functional locally and most of the time it works fine when deployed, I think the code is fine.
// Check for new or updated alerts every hour
const alertsURL = `https://api.weather.gov/alerts/active?point=${lat},${lon}`;
try {
response = await axios.get(alertsURL,
headers: {
"Content-Encoding": "gzip",
"User-Agent": userAgent
timeout: 5000
} catch (e) {
this.logger.error(`ForecastData: alert: ${e}`);
With ~10 triggers all firing on different intervals, I am wondering if there is some kind of outbound connection limit that I hit every once in a while. I checked the function configuration options and I did not see anything.
Any help would be appreciated.
I get mostly timeout errors like this: Error: timeout of 2000ms exceeded
Some request have 5s or 10s timeouts. It does not seem to matter.
I made changes to reduce the overall network requests and that has not helped.