rest - Http Post 请求导致流结束

标签 rest http neo4j http-headers resttemplate

我遇到了这个奇怪的问题。我在本地计算机上运行我的应用程序和 Neo4j 服务器。

我在应用程序中发出 POST 请求以在 Neo4j 中开始事务(日志中的第一行):

18/02 13:33:30 DEBUG (http.headers) http-outgoing-0 >> POST /db/data/transaction/ HTTP/1.1
18/02 13:33:30 DEBUG (http.headers) http-outgoing-0 >> Accept: application/json, application/*+json
18/02 13:33:30 DEBUG (http.headers) http-outgoing-0 >> Content-Type: application/json
18/02 13:33:30 DEBUG (http.headers) http-outgoing-0 >> X-Stream: true
18/02 13:33:30 DEBUG (http.headers) http-outgoing-0 >> workSpaceId: NOT_AVAILABLE
18/02 13:33:30 DEBUG (http.headers) http-outgoing-0 >> neo4jRequestType: WRITE
18/02 13:33:30 DEBUG (http.headers) http-outgoing-0 >> threadUUID: 26b39600-abf1-440f-b08f-3350ee8ecdb1
18/02 13:33:30 DEBUG (http.headers) http-outgoing-0 >> Content-Length: 0
18/02 13:33:30 DEBUG (http.headers) http-outgoing-0 >> Host: localhost:7474
18/02 13:33:30 DEBUG (http.headers) http-outgoing-0 >> Connection: Keep-Alive
18/02 13:33:30 DEBUG (http.headers) http-outgoing-0 >> User-Agent: Apache-HttpClient/4.3.5 (java 1.5)
18/02 13:33:30 DEBUG (http.headers) http-outgoing-0 >> Accept-Encoding: gzip,deflate
18/02 13:33:30 DEBUG (http.wire) http-outgoing-0 >> "POST /db/data/transaction/ HTTP/1.1[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-0 >> "Accept: application/json, application/*+json[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-0 >> "Content-Type: application/json[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-0 >> "X-Stream: true[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-0 >> "workSpaceId: NOT_AVAILABLE[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-1 << "HTTP/1.1 201 Created[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-1 << "Location: http://localhost:7474/db/data/transaction/705[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-1 << "Content-Type: application/json[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-1 << "Access-Control-Allow-Origin: *[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-1 << "Transfer-Encoding: chunked[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-1 << "Server: Jetty(9.0.5.v20130815)[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-1 << "[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-1 << "96[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-5 << "HTTP/1.1 201 Created[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-5 << "Location: http://localhost:7474/db/data/transaction/704[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-1 << "{"commit":"http://localhost:7474/db/data/transaction/705/commit","results":[],"transaction":{"expires":"Wed, 18 Feb 2015 02:34:30 +0000"},"errors":[]}"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-6 << "HTTP/1.1 201 Created[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-6 << "Location: http://localhost:7474/db/data/transaction/706[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-6 << "Content-Type: application/json[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-6 << "Access-Control-Allow-Origin: *[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-6 << "Transfer-Encoding: chunked[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-6 << "Server: Jetty(9.0.5.v20130815)[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-6 << "[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-6 << "96[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-6 << "{"commit":"http://localhost:7474/db/data/transaction/706/commit","results":[],"transaction":{"expires":"Wed, 18 Feb 2015 02:34:30 +0000"},"errors":[]}[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-6 << "0[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-0 >> "neo4jRequestType: WRITE[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-6 << "[\r][\n]"
18/02 13:33:30 DEBUG (http.headers) http-outgoing-1 << HTTP/1.1 201 Created
18/02 13:33:30 DEBUG (http.headers) http-outgoing-1 << Location: http://localhost:7474/db/data/transaction/705
18/02 13:33:30 DEBUG (http.headers) http-outgoing-1 << Content-Type: application/json
18/02 13:33:30 DEBUG (http.headers) http-outgoing-1 << Access-Control-Allow-Origin: *
18/02 13:33:30 DEBUG (http.headers) http-outgoing-1 << Transfer-Encoding: chunked
18/02 13:33:30 DEBUG (http.headers) http-outgoing-1 << Server: Jetty(9.0.5.v20130815)
18/02 13:33:30 DEBUG (http.wire) http-outgoing-5 << "Content-Type: application/json[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-5 << "Access-Control-Allow-Origin: *[\r][\n]"
18/02 13:33:30 DEBUG (http.wire) http-outgoing-5 << "Transfer-Encoding: chunked[\r][\n]"
18/02 13:33:30 DEBUG (http.headers) http-outgoing-6 << HTTP/1.1 201 Created
18/02 13:33:31 DEBUG (http.headers) http-outgoing-6 << Location: http://localhost:7474/db/data/transaction/706
18/02 13:33:31 DEBUG (http.headers) http-outgoing-6 << Content-Type: application/json
18/02 13:33:31 DEBUG (http.headers) http-outgoing-6 << Access-Control-Allow-Origin: *
18/02 13:33:31 DEBUG (http.headers) http-outgoing-6 << Transfer-Encoding: chunked
18/02 13:33:31 DEBUG (http.headers) http-outgoing-6 << Server: Jetty(9.0.5.v20130815)
18/02 13:33:31 DEBUG (execchain.MainClientExec) Connection can be kept alive indefinitely
18/02 13:33:30 DEBUG (http.wire) http-outgoing-0 >> "threadUUID: 26b39600-abf1-440f-b08f-3350ee8ecdb1[\r][\n]"
18/02 13:33:31 DEBUG (http.wire) http-outgoing-0 >> "Content-Length: 0[\r][\n]"
18/02 13:33:31 DEBUG (http.wire) http-outgoing-0 >> "Host: localhost:7474[\r][\n]"
18/02 13:33:31 DEBUG (http.wire) http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
18/02 13:33:31 DEBUG (http.wire) http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.3.5 (java 1.5)[\r][\n]"
18/02 13:33:31 DEBUG (http.wire) http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
18/02 13:33:31 DEBUG (http.wire) http-outgoing-0 >> "[\r][\n]"
18/02 13:33:30 DEBUG (execchain.MainClientExec) Connection can be kept alive indefinitely
18/02 13:33:31 DEBUG (http.wire) http-outgoing-0 << "end of stream"

我得到的响应是“流结束”(日志中的最后一行)。

我检查了服务器 http 日志,它没有这个请求(使用 http header 中的 threadUUID 参数搜索)。因此,我没有收到此请求的任何交易。

我无法弄清楚这个“流结束”是什么以及它的原因是什么?

另外,我可以看到一些超时:

18/02 13:34:30 DEBUG (http.wire) http-outgoing-8 << "[read] I/O error: Read timed out"

有什么想法吗?

最佳答案

这正在发生在我们身上。关闭连接然后读取超时似乎是正常的。我还在调查。在我们的情况下更糟,因为在此之后我们有请求将一个请求(正在进行的请求)的 URL 与另一个请求的正文混合在一起,这可能发生在不同的连接、不同的线程和 20 分钟前......

所以这很吓人。

关于rest - Http Post 请求导致流结束,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28575729/

相关文章:

json - 如何跟踪通过 elastic4s 客户端发送到 Elasticsearch 的 json 请求?

Javascript/REST/Activiti - 我在 XMLHttpRequest 中做错了什么?

java - 如何改善微服务之间的通信

c# - 带有 ASP.NET 的 Entity Framework 为一对多集合返回 null

http - 转到 http POST 文件

java - Java中如何比较和统计多个Streams的元素?

api - Yii2 Rest API 承载身份验证

java - 是否可以通过 POST 发送 JSONArray 而不是 JSONObject?

java - 使用 neo4j 查找与给定节点有关系的节点集的有效方法

Neo4j cypher 使用所有关系获取与另一个节点相关的节点