Bug 460995 - Java Http post request to an API causes infinite response loop if http-code-500 is returned twice
Summary: Java Http post request to an API causes infinite response loop if http-code-5...
Status: RESOLVED NOT_ECLIPSE
Alias: None
Product: PDE
Classification: Eclipse Project
Component: API Tools (show other bugs)
Version: 4.5   Edit
Hardware: PC Windows 8
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PDE API Tools Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: api, greatbug
Depends on:
Blocks:
 
Reported: 2015-02-26 15:39 EST by nils honermann CLA
Modified: 2015-09-09 04:36 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nils honermann CLA 2015-02-26 15:39:22 EST
you can cause the java http post library to an infinity loop so it will get stucked by doing the following:

- Using the Java HTTP library to send a http-based POST request to any API
- the API can't handle the given parameters and returns an internal server error 500
- do another http post request that causes a 500 response too (can also be a different post just the http-state 500 response matters)
- now the java http library can't recieve any responses and it stucks (even if the third response would cause a correct http-state 200)
Comment 1 nils honermann CLA 2015-02-26 15:44:09 EST
i hope i placed it to the correct product (+product version)
this bug is influenced by "java-http-(post)-library" and a given "http-based-API"
Comment 2 Vikas Chandra CLA 2015-02-27 13:47:33 EST
This doesnt look like API tools bug.
Comment 3 nils honermann CLA 2015-03-05 12:29:45 EST
I was using the following packages:

---import org.apache.commons.httpclient.HttpClient;
to create a HttpClient

and than i used a HttpRequest (as a post request with parameters)
---HttpResponse response = request.execute();

and sent it to another PC which was running an API.
That API was running in the Microsoft IIS and it tried to get a boolean parameter from the post request to calculate something and send back a request.
If the parameter was a boolean value everything worked out perfectly, but if it wasn't the API couldnt handle it (and it had not a fallback, which is bad programming though).
The API throwed a parsing error without handling it and the IIS (which has a fallback) returned <HTTP-500-InternalServerError>.

So good so far.
Now this <HTTP-500-InternalServerError> is recived by my Java-client and stored inside the HttpResponse Object and i can print it to the console for example.
If I do the same procedure again it will work quite the same way, I am able to read the HttpResponse again and so on,
BUT
if the second HttpResponse was a <Http-500-InternalServerError> again I am totally unable to send anymore HttpRequests with my Java-client and if I try it will cause to an infinite loop. (And you have to terminate the Application)


I hope someone can tell me which topic this bug belongs to :)
Comment 4 Vikas Chandra CLA 2015-09-09 04:36:47 EDT
see my previous comment