From 36cfdf68b15932ac3970a5e0c81462e42adaf1da Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Thu, 1 Mar 2018 15:52:26 -0500 Subject: [PATCH] Correct log level Issue: SPR-16528 --- .../servlet/mvc/method/annotation/ResponseBodyEmitter.java | 6 +++++- .../method/annotation/ResponseEntityExceptionHandler.java | 6 +++--- .../mvc/support/DefaultHandlerExceptionResolver.java | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitter.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitter.java index 97b7cf24d2..d5096cb9e4 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitter.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -190,6 +190,10 @@ public class ResponseBodyEmitter { * Complete request processing. *

A dispatch is made into the app server where Spring MVC completes * asynchronous request processing. + *

Note: you do not need to call this method after an + * {@link IOException} from any of the {@code send} methods. The Servlet + * container will generate an error notification that Spring MVC will process + * and handle through the exception resolver mechanism and then complete. */ public synchronized void complete() { this.complete = true; diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseEntityExceptionHandler.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseEntityExceptionHandler.java index 9d31e474f0..c378356122 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseEntityExceptionHandler.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseEntityExceptionHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -457,8 +457,8 @@ public abstract class ResponseEntityExceptionHandler { HttpServletRequest request = servletWebRequest.getRequest(); HttpServletResponse response = servletWebRequest.getResponse(); if (response != null && response.isCommitted()) { - if (logger.isErrorEnabled()) { - logger.error("Async timeout for " + request.getMethod() + " [" + request.getRequestURI() + "]"); + if (logger.isDebugEnabled()) { + logger.debug("Async timeout for " + request.getMethod() + " [" + request.getRequestURI() + "]"); } return null; } diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java index e4043f4248..61317a4430 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java @@ -536,8 +536,8 @@ public class DefaultHandlerExceptionResolver extends AbstractHandlerExceptionRes if (!response.isCommitted()) { response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE); } - else if (logger.isErrorEnabled()) { - logger.error("Async timeout for " + request.getMethod() + " [" + request.getRequestURI() + "]"); + else if (logger.isDebugEnabled()) { + logger.debug("Async timeout for " + request.getMethod() + " [" + request.getRequestURI() + "]"); } return new ModelAndView(); }