Closed GoogleCodeExporter closed 9 years ago
As it turns out, this is not that hard to reproduce. Here is an example:
final int COUNT = 340;
String[] ids = new String[COUNT];
for (int i = 0; i < COUNT; i++)
{
ids[i] = "i-100" + i;
}
Jec2 jec2 = new Jec2("replace with a real access key", "replace with a real secret key", true, "us-east-
1.ec2.amazonaws.com");
jec2.setMaxRetries(0);
jec2.terminateInstances(ids);
This consistently produces the following exception:
Exception in thread "main" com.xerox.amazonws.ec2.EC2Exception: Number of
retries exceeded :
TerminateInstances
at com.xerox.amazonws.ec2.Jec2.makeRequestInt(Jec2.java:1838)
at com.xerox.amazonws.ec2.Jec2.terminateInstances(Jec2.java:625)
at com.xerox.amazonws.ec2.Jec2.terminateInstances(Jec2.java:606)
Caused by: org.apache.commons.httpclient.HttpException: Number of retries
exceeded : TerminateInstances
at com.xerox.amazonws.common.AWSQueryConnection.makeRequest(AWSQueryConnection.java:373)
at com.xerox.amazonws.ec2.Jec2.makeRequestInt(Jec2.java:1830)
... 3 more
Caused by: com.xerox.amazonws.common.AWSException: Connection reset
at com.xerox.amazonws.common.AWSQueryConnection.makeRequest(AWSQueryConnection.java:344)
... 4 more
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:293)
at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:331)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:789)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:746)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionA
dapter.readLine(Mult
iThreadedHttpConnectionManager.java:1413)
at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
at com.xerox.amazonws.common.AWSQueryConnection.makeRequest(AWSQueryConnection.java:340)
... 4 more
Original comment by msol...@gmail.com
on 25 Nov 2009 at 7:10
I can confirm that after making the following changes, everything works. I
tried up to 1,000 instance ID's and
got the correct error ("Invalid id") instead of the connection reset:
1) Using POST instead of GET
2) Using a request entity (i.e. request body) instead of a query string
3) Removing the initial "?" from the request (since it's no longer a query
string)
Note that according to the "boto" issue, this same change might be required to
support the runInstances()
method with very large user data.
Original comment by msol...@gmail.com
on 25 Nov 2009 at 5:05
Thanks, I'm going to try changing both runInstances and terminateInstances
Original comment by dkavan...@gmail.com
on 23 Mar 2010 at 11:13
This issue was closed by revision r317.
Original comment by dkavan...@gmail.com
on 24 Mar 2010 at 12:48
This has been fixed in SVN r317
Original comment by dkavan...@gmail.com
on 24 Mar 2010 at 12:48
Thanks!
Original comment by msol...@gmail.com
on 24 Mar 2010 at 8:12
Original issue reported on code.google.com by
msol...@gmail.com
on 25 Nov 2009 at 6:32