我们已经公开了一些REST API。我们在服务器上几次看到IOExceptions。我们不确定如何从中恢复。
我们看到的那种I / O错误是
客户端超时 - 我们发送了client_timed_out http错误代码和客户端重试。这很有效。
数据无效。例如,我们看到的是“无效的CRLF”。这可能是客户端错误,也可能是TCP / IP堆栈出错的地方。
您认为这可能发生在TCP / IP级别吗?如果是,则Http协议不应具有服务器可以发送给客户端的错误代码,客户端可以选择重试请求。
异常堆栈跟踪
java.io.IOException: Invalid CRLF
at org.apache.coyote.http11.filters.ChunkedInputFilter.parseCRLF(ChunkedInputFilter.java:364)
at org.apache.coyote.http11.filters.ChunkedInputFilter.doRead(ChunkedInputFilter.java:145)
at org.apache.coyote.http11.AbstractInputBuffer.doRead(AbstractInputBuffer.java:308)
at org.apache.coyote.Request.doRead(Request.java:422)
at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:287)
at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:374)
at org.apache.catalina.connector.InputBuffer.readByte(InputBuffer.java:300)
at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:108)
at java.io.FilterInputStream.read(FilterInputStream.java:66)
at java.util.zip.CheckedInputStream.read(CheckedInputStream.java:42)
at java.util.zip.GZIPInputStream.readUByte(GZIPInputStream.java:247)
at java.util.zip.GZIPInputStream.readUShort(GZIPInputStream.java:239)
at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:142)
at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:58)
at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:67)
at org.restlet.engine.application.DecodeRepresentation.getDecodedStream(DecodeRepresentation.java:142)
at org.restlet.engine.application.DecodeRepresentation.getStream(DecodeRepresentation.java:212)
at com.inlogy.server.ingraph.service.apis.resource.DocumentHashMapResource.post(DocumentHashMapResource.java:57)
at org.restlet.resource.ServerResource.doHandle(ServerResource.java:380)