admin管理员组

文章数量:1122846

I have a gateway A that calls my service B (spring boot app 3.3.3)
The http client of the gateway has a timeout of 10s when calling microservice B

Sometimes when service B exceed 10s, i have this exception AsyncRequestNotUsableException as a warning not an error,
I think it's because the gateway has closed the socket, but what i don't understand is why my service B responds with a 200 code status !

can you explain me why service B hasn't responded with some 5xx ? and why I see the async keyword in the exception name ? I thought we are using only sync with apache tomcat

Exception:
org.springframework.web.context.request.async.AsyncRequestNotUsableException
Message:
ServletOutputStream failed to write: java.io.IOException: Broken pipe
Stacktrace:
org.springframework.web.context.request.async.StandardServletAsyncWebRequest$LifecycleHttpServletResponse.handleIOException
org.springframework.web.context.request.async.StandardServletAsyncWebRequest$LifecycleServletOutputStream.write
org.springframework.util.StreamUtils$NonClosingOutputStream.write
com.fasterxml.jackson.core.json.UTF8JsonGenerator._flushBuffer
com.fasterxml.jackson.core.json.UTF8JsonGenerator._verifyValueWrite
com.fasterxml.jackson.core.json.UTF8JsonGenerator.writeStartObject
com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize
com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize
com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeOptionalFields
com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeWithoutTypeInfo
com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize
com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize
com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serializeContents
com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize
com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize
com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeOptionalFields
com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeWithoutTypeInfo
com.fasterxml.jackson.databind.ser.AnyGetterWriter.getAndSerialize
com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields
com.fasterxml.jackson.databind.ser.impl.UnwrappingBeanSerializer.serialize
org.springframework.hateoas.EntityModel$MapSuppressingUnwrappingSerializer.serialize
com.fasterxml.jackson.databind.ser.impl.UnwrappingBeanPropertyWriter.serializeAsField
com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields
com.fasterxml.jackson.databind.ser.BeanSerializer.serialize
com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serializeContents
com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize
com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize
com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField
com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields
com.fasterxml.jackson.databind.ser.BeanSerializer.serialize
com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize
com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue
com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize
com.fasterxml.jackson.databind.ObjectWriter.writeValue
org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal
org.springframework.http.converter.AbstractGenericHttpMessageConverter.write
org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters
org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue
org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue
org.springframework.hateoas.server.mvc.RepresentationModelProcessorHandlerMethodReturnValueHandler.handleReturnValue
org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle

本文标签: Spring MVC responds with 200 even with AsyncRequestNotUsableExceptionStack Overflow