stopRuntime
()
| 353 | |
| 354 | // stopRuntime |
| 355 | func (info *RuntimeInfo) stopRuntime() { |
| 356 | info.invokeLock.Lock() |
| 357 | defer info.invokeLock.Unlock() |
| 358 | |
| 359 | logs.V(5).Infof("close runtime %s", info.RuntimeID) |
| 360 | |
| 361 | info.PreLoadTimeMS = 0 |
| 362 | info.PostLoadTimeMS = 0 |
| 363 | info.PreInitTimeMS = 0 |
| 364 | info.PostInitTimeMS = 0 |
| 365 | info.AcceptReqCnt = 0 |
| 366 | info.RejectReqCnt = 0 |
| 367 | info.Concurrency = 0 |
| 368 | |
| 369 | info.requestMap.Range(func(key, value interface{}) bool { |
| 370 | id := key.(string) |
| 371 | request := value.(*RequestInfo) |
| 372 | request.InvokeResult(StatusFailed, fmt.Sprintf("RequestID: %s Process exited before completing request", id)) |
| 373 | request.Notify() |
| 374 | return true |
| 375 | }) |
| 376 | info.requestMap = sync.Map{} |
| 377 | close(info.runtimeStopChan) |
| 378 | if !info.WithStreamMode { |
| 379 | info.runtimeConn.Close() |
| 380 | } else { |
| 381 | info.httpClient = nil |
| 382 | } |
| 383 | info.runtimeWaitGroup.Wait() |
| 384 | info.updateStreamMode(false) |
| 385 | |
| 386 | info.SetState(RuntimeStateStopped) |
| 387 | |
| 388 | info.runtimeRunChan = make(chan struct{}) |
| 389 | } |
| 390 | |
| 391 | // InvokeFunc |
| 392 | func (info *RuntimeInfo) InvokeFunc(request *RequestInfo, invokeReq *InvokeRequest) error { |
no test coverage detected