mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
fn: user friendly timeout handling changes (#1021)
* fn: user friendly timeout handling changes Timeout setting in routes now means "maximum amount of time a function can run in a container". Total wait time for a given http request is now expected to be handled by the client. As long as the client waits, the LB, runner or agents will search for resources to schedule it.
This commit is contained in:
@@ -67,8 +67,7 @@ type callHandle struct {
|
||||
c *call // the agent's version of call
|
||||
|
||||
// Timings, for metrics:
|
||||
receivedTime strfmt.DateTime // When was the call received?
|
||||
allocatedTime strfmt.DateTime // When did we finish allocating capacity?
|
||||
receivedTime strfmt.DateTime // When was the call received?
|
||||
|
||||
// For implementing http.ResponseWriter:
|
||||
headers http.Header
|
||||
@@ -530,7 +529,7 @@ func (pr *pureRunner) handleTryCall(tc *runner.TryCall, state *callHandle) error
|
||||
return err
|
||||
}
|
||||
|
||||
agent_call, err := pr.a.GetCall(FromModelAndInput(&c, state.pipeToFnR), WithWriter(state))
|
||||
agent_call, err := pr.a.GetCall(FromModelAndInput(&c, state.pipeToFnR), WithWriter(state), WithContext(state.ctx))
|
||||
if err != nil {
|
||||
state.enqueueCallResponse(err)
|
||||
return err
|
||||
@@ -545,7 +544,6 @@ func (pr *pureRunner) handleTryCall(tc *runner.TryCall, state *callHandle) error
|
||||
}
|
||||
state.c.slotHashId = string(hashId[:])
|
||||
}
|
||||
state.allocatedTime = strfmt.DateTime(time.Now())
|
||||
pr.spawnSubmit(state)
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user