Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP Keep-Alive mass inserting problem with REST [moved] #142

Closed
lvca opened this issue Dec 10, 2012 · 0 comments
Closed

HTTP Keep-Alive mass inserting problem with REST [moved] #142

lvca opened this issue Dec 10, 2012 · 0 comments

Comments

@lvca
Copy link
Member

lvca commented Dec 10, 2012

This is Issue 142 moved from a Google Code project.
Added by 2010-10-26T00:06:23.000Z by gsta...@gmail.com.
Please review that bug for more context and additional comments, but update this bug.
Closed (Fixed).

Original labels: Type-Defect, Priority-Medium, v0.9.24

Original description

Mass inserting documents at full speed through the REST interface, very often one or more of the requests will fail. Sniffing the connection, I noticed it responded to the request before the client had finished sending the body through. I am using a keep-alive connection, always waiting for the response to end before proceeding to the next request. So this doesn't make sense, my client doesn't terminate the connection since I see from the sniffer that the rest of the request is sent right after the early mistaken response. Here's a portion from the dump where the problem occurs:

Receive: Return Code: 0x00000000
POST /document/test HTTP/1.1
Connection: Keep-Alive
Host: localhost:2480
Authorization: Basic d3JpdGVyOndyaXRlcg==
Content-Length: 93
Cookie: OSESSIONID=OS1288050027234-8020996841936858574

{"@class":"bench","name":"Some medium string here","other":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}

Send: Return Code: 0x00000000
HTTP/1.1 201 OK
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Date: Tue Oct 26 02:40:27 EEST 2010
Content-Type: text/plain
Server: OrientDB Server v.0.9.24-SNAPSHOT
Connection: Keep-Alive
Set-Cookie: OSESSIONID=OS1288050027234-8020996841936858574; Path=/; HttpOnly
CONTENT-LENGTH: 9

12:103161

Receive: Return Code: 0x00000000
POST /document/test HTTP/1.1
Connection: Keep-Alive
Host: localhost:2480
Authorization: Basic d3JpdGVyOndyaXRlcg==
Content-Length: 93
Cookie: OSESSIONID=OS1288050027234-8020996841936858574

{"@class":"bench","name":"S

Send: Return Code: 0x00000000
HTTP/1.1 500 Unknow error
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Date: Tue Oct 26 02:40:27 EEST 2010
Content-Type: text/plain
Server: OrientDB Server v.0.9.24-SNAPSHOT
Connection: Keep-Alive
CONTENT-LENGTH: 137

com.orientechnologies.orient.core.exception.OSerializationException: Error on unmarshalling JSON content: content must be embraced by { }


Receive: Return Code: 0x00000000
ome medium string here","other":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}

Receive: Return Code: 0x00000000
POST /document/test HTTP/1.1
Connection: Keep-Alive
Host: localhost:2480
Authorization: Basic d3JpdGVyOndyaXRlcg==
Content-Length: 93
Cookie: OSESSIONID=OS1288050027234-8020996841936858574

{"@class":"bench","name":"Some medium string here","other":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}

Send: Return Code: 0x00000000
string 405 Command 'edium' not found
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Date: Tue Oct 26 02:40:27 EEST 2010
Content-Type: text/plain
Server: OrientDB Server v.0.9.24-SNAPSHOT
Connection: Keep-Alive
CONTENT-LENGTH: 24

Command not found: edium

-----------------------------

Also, the same problem with the CRLF exists in the 405 response also:

00000100  2D 4C 45 4E 47 54 48 3A 20 32 34 0D 0A 0D 0A 43    -LENGTH: 24....C
00000110  6F 6D 6D 61 6E 64 20 6E 6F 74 20 66 6F 75 6E 64    ommand not found
00000120  3A 20 65 64 69 75 6D 0D 0A                         : edium..       

which breaks the http parser again.


These headers may have problems also:

HTTP/1.1 201 OK
HTTP/1.1 500 Unknow error
string 405 Command 'edium' not found


These are the proper responses, taken from the RFC2616 HTTP/1.1 protocol:

201 Created
500 Internal Server Error
405 Method Not Allowed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant