I've a reactive microservice application (we will call this microservice X) with the following dependencies: Spring Boot v2.2.8.RELEASE, SpringWebFlux v5.2.7.RELEASE, Spring v5.2.7.RELEASE, Undertow core 2.0.30.Final, deploying it in a k8s environment. In this environment, there is another microservice (we will call this microservice Y) sending an HTTP request to the microservice X; the call is made through the k8s service. Randomly, it happens the following error when Y calls X:
log of microservice Y:
<microservice-Y-name>,7,[https-jsse-nio-8080-exec-2],ERROR,....
org.springframework.web.client.ResourceAccessException: I/O error on POST request for "https://hostname.svc.k8s.xxx.com/<microservice-X-name>/api/tasks": Unexpected end of file from server; nested exception is java.net.SocketException: Unexpected end of file from server
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:748)
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:651)
log of microservice X:
SSL read loop detected. This should not happen, please report this to the Undertow developers. Current state SslConduit{state=20, outstandingTasks=0, wrappedData=null, dataToUnwrap=DefaultPooledBuffer{buffer=java.nio.DirectByteBuffer[pos=5461 lim=6026 cap=17408], referenceCount=1}, unwrappedData=null}
28-08-2020 07:43:24.514,microservice-X-name,7,[boundedElastic-3876],ERROR,c.w.o.o.w.d.HttpErrorHandler,,,,,,,,..... : {}
org.springframework.web.server.ServerWebInputException: 400 BAD_REQUEST "Request body is missing: ....
at org.springframework.web.reactive.result.method.annotation.AbstractMessageReaderArgumentResolver.handleMissingBody(AbstractMessageReaderArgumentResolver.java:230)
at org.springframework.web.reactive.result.method.annotation.AbstractMessageReaderArgumentResolver.lambda$readBody$5(AbstractMessageReaderArgumentResolver.java:194)
at reactor.core.publisher.MonoErrorSupplied.subscribe(MonoErrorSupplied.java:70)
Changing the microservice Y configuration in order to invoke the microservice X via k8s ingress instead of via k8s service, the error never occurs.
Any idea as of why this could happen?