6 Commits

Author SHA1 Message Date
Alex Ellis (OpenFaaS Ltd)
49053feac7 Clarify EULA applies to this project since 2019
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2024-11-18 21:20:38 +00:00
Alex Ellis (OpenFaaS Ltd)
88eea5f62e Feature for probing functions
Introduces a single-flight call to a function's health
endpoint to verify that it is registered with an Istio
sidecar (Envoy) before letting the invocation through.

Results are cached for 5 seconds, before a probe is
required again.

Tested without Istio, with probe_functions environment
variable set to true, I saw a probe execute in the logs.

Fixes: #1721 for Istio users.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
2022-07-07 10:35:07 +01:00
Alex Ellis (OpenFaaS Ltd)
01841f605c Use sync package from unofficial Go library
Uses the sync package from the unofficial Go library instead
of simpler solution.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
2022-06-29 09:43:58 +01:00
Alex Ellis (OpenFaaS Ltd)
6ed0ab71fb Move to single-flight for back-end queries
When querying for replicas during a scale up event, then the
gateway can overwhelm the provider with requests. This is
especially true under high concurrent load.

The changes in this PR limit the inflight requests.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
2022-06-29 09:43:58 +01:00
Alex Ellis (OpenFaaS Ltd)
5741610f31 Return cached query when hit
The code was calling into the cache twice, even if the first
call was a cache hit and not a miss.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-05-06 18:32:51 +01:00
Alex Ellis (OpenFaaS Ltd)
18f6c720b5 Extract a caching function_query type
This type abstracts the function_query type and introduces an
interface for testing and substitution.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-04-22 15:26:42 +01:00