MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / runnerHandler

Method runnerHandler

pkg/controller/rtctrl/dispatcherv2.go:219–237  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

217}
218
219func (s *DispatchServerV2) runnerHandler(w http.ResponseWriter, r *http.Request) {
220 runtimeID := r.Header.Get("x-cfc-runtimeid")
221 logs.Infof("runner %s connect", runtimeID)
222
223 conn, buf, ok := setupHijackConn(w, r)
224 if !ok {
225 logs.Errorf("setupHijackConn runtime %s failed", runtimeID)
226 return
227 }
228
229 rt, err := s.runtimeDispatcher.GetRuntime(runtimeID)
230 if err != nil {
231 logs.Errorf("can't get runtime %s from runner connection", runtimeID)
232 return
233 }
234 if err := rt.startRunnerLoop(&startRunnerParams{conn: conn, buf: buf}); err != nil {
235 logs.Errorf("init runner %s failed: %s", rt.RuntimeID, err.Error())
236 }
237}
238
239func (s *DispatchServerV2) StartRecvLog(runtimeID, requestID string, store LogStatStore) {
240 st := s.statsMap.get(runtimeID)

Callers 1

TestRunnerHandlerFunction · 0.95

Calls 7

InfofFunction · 0.92
ErrorfFunction · 0.92
setupHijackConnFunction · 0.85
startRunnerLoopMethod · 0.80
GetMethod · 0.65
GetRuntimeMethod · 0.65
ErrorMethod · 0.45

Tested by 1

TestRunnerHandlerFunction · 0.76