1

Closed

Exception: An existing connection was forcibly closed by the remote host

description

hello, i encounter a problem when inserting a large value to a column, the value byte[] length is 25130744 (converted from DataSet to byte[]), and gives me an exception: IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
Anyone know the reason? Small column values work fine. Are there some data size limit or request timeout limit in Aquiles or Cassandra server?
 
Cassandra version: 1.0.2, Aquiles version: 1.0
 
Here is the detailed info:
Server Error in '/test' Application.
 
An existing connection was forcibly closed by the remote host
 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
 
Source Error:
 
 
Line 482: public void recv_insert()
Line 483: {
Line 484: TMessage msg = iprot_.ReadMessageBegin();
Line 485: if (msg.Type == TMessageType.Exception) {
Line 486: TApplicationException x = TApplicationException.Read(iprot_);
 
Source File: D:\codeplex\Aquiles\trunk\Aquiles.Cassandra10\Apache\Cassandra\Cassandra.cs Line: 484
 
Stack Trace:
 
 
[SocketException (0x2746): An existing connection was forcibly closed by the remote host]
System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) +245
 
[IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.]
System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) +7768653
Thrift.Transport.TStreamTransport.Read(Byte[] buf, Int32 off, Int32 len) in d:\thrift-0.6.0\thrift-0.6.0\lib\csharp\src\Transport\TStreamTransport.cs:84
Thrift.Transport.TTransport.ReadAll(Byte[] buf, Int32 off, Int32 len) in d:\thrift-0.6.0\thrift-0.6.0\lib\csharp\src\Transport\TTransport.cs:54
Thrift.Transport.TFramedTransport.ReadFrame() in d:\thrift-0.6.0\thrift-0.6.0\lib\csharp\src\Transport\TFramedTransport.cs:90
Thrift.Transport.TFramedTransport.Read(Byte[] buf, Int32 off, Int32 len) in d:\thrift-0.6.0\thrift-0.6.0\lib\csharp\src\Transport\TFramedTransport.cs:83
Thrift.Transport.TTransport.ReadAll(Byte[] buf, Int32 off, Int32 len) in d:\thrift-0.6.0\thrift-0.6.0\lib\csharp\src\Transport\TTransport.cs:54
Thrift.Protocol.TBinaryProtocol.ReadI32() in d:\thrift-0.6.0\thrift-0.6.0\lib\csharp\src\Protocol\TBinaryProtocol.cs:338
Thrift.Protocol.TBinaryProtocol.ReadMessageBegin() in d:\thrift-0.6.0\thrift-0.6.0\lib\csharp\src\Protocol\TBinaryProtocol.cs:220
Apache.Cassandra.Client.recv_insert() in D:\codeplex\Aquiles\trunk\Aquiles.Cassandra10\Apache\Cassandra\Cassandra.cs:484
DataAccessLib.CassandraAccess.<>c__DisplayClass28.<InsertCommand>b__27(Client client) in C:\TestProject\Class1.cs:746
 
[ExecutionBlockException: Exception 'Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.' during executing command. See inner exception for further details.]
Aquiles.Core.Cluster.Impl.DefaultCluster.Execute(Delegate executionBlock, String keyspaceName, ConnectionConfig overrideConnectionConfig) in D:\codeplex\Aquiles\trunk\Aquiles.Core\Cluster\Impl\DefaultCluster.cs:191
Closed Jan 16, 2012 at 4:50 PM by javiercanillas
Fixed. There is nothing wrong in the code.

comments

javiercanillas wrote Dec 10, 2011 at 2:54 AM

I think your problem is that 25m is larger than 15 or even 16 that is the max support stream within Cassandra default configuration.

take a look at the following values inside cassandra.yaml:

Frame size for thrift (maximum field length).

0 disables TFramedTransport in favor of TSocket. This option

is deprecated; we strongly recommend using Framed mode.

thrift_framed_transport_size_in_mb: 15

The max length of a thrift message, including all fields and

internal thrift overhead.

thrift_max_message_length_in_mb: 16

Play around and let me know.

xamlguide wrote Dec 12, 2011 at 3:00 AM

It works, thanks:)