Http Post请求导致流结束

时间:2015-02-18 03:59:10

标签: 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头中的threadUUID参数进行搜索)。所以,我没有收到任何关于此请求的交易。

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

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

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

任何想法的人?

1 个答案:

答案 0 :(得分:0)

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

所以它吓到了。