在使用K8S rolling update的时候,我同时使用JMeter不间断call API,就有少部分请求抛出了这个错误
{
"timestamp":"2019-12-02T07:33:47.120+0000",
"status":500,
"error":"Internal Server Error",
"message":"No message available",
"path":"/api/anon/article/TW1Tq/feed"
}
上面的异常是SpringBoot的BasicErrorController抛出的带有错误,HTTP状态和异常消息的详细信息的JSON响应
package org.springframework.boot.autoconfigure.web.servlet.error;
//...
@Controller
@RequestMapping("${server.error.path:${error.path:/error}}")
public class BasicErrorController extends AbstractErrorController {
//...
@RequestMapping
public ResponseEntity<Map<String, Object>> error(HttpServletRequest request) {
// 方法内部组装了timestamp,error,message,path等信息
Map<String, Object> body = getErrorAttributes(request,
isIncludeStackTrace(request, MediaType.ALL));
HttpStatus status =