mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
fn: introducing 503 responses for out of capacity case (#518)
* fn: introducing 503 responses for out of capacity case *) Adding 503 with Retry-After header case if request failed during waiting for slots. *) TODO: return 503 without Retry-After if the request can never be met by this fn server. *) fn: runner test docker pull fixup *) fn: MaxMemory for routes is now a variable to allow testing and adjusting it according to fleet memory sizes.
This commit is contained in:
@@ -17,9 +17,10 @@ const (
|
||||
MaxSyncTimeout = 120 // 2 minutes
|
||||
MaxAsyncTimeout = 3600 // 1 hour
|
||||
MaxIdleTimeout = MaxAsyncTimeout
|
||||
MaxMemory = 1024 * 8 // 8GB TODO should probably be a var of machine max?
|
||||
)
|
||||
|
||||
var RouteMaxMemory = uint64(8 * 1024) // 8GB TODO should probably be a var of machine max?
|
||||
|
||||
type Routes []*Route
|
||||
|
||||
type Route struct {
|
||||
@@ -112,7 +113,7 @@ func (r *Route) Validate() error {
|
||||
return ErrRoutesInvalidIdleTimeout
|
||||
}
|
||||
|
||||
if r.Memory < 1 || r.Memory > MaxMemory {
|
||||
if r.Memory < 1 || r.Memory > RouteMaxMemory {
|
||||
return ErrRoutesInvalidMemory
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user