System.ServiceModel.CommunicationException: The soquet connections was ended....
-
יום ראשון 29 יולי 2012 17:41
Hi, I have a problem with inter role communication.
I have a service contract as follow:
[ServiceContract]
public interface IQueryService
{
[OperationContract]
QueryData GetQueryData();
}The QueryData contract is defined as follows:
[DataContract]
public class QueryData
{
[DataMember]
public List<KeyValue> Results { get; set; }
}Where the KeyValue class is defined as follows:
public class KeyValue
{
public string Key { get; set; }
public QueryEntry Value { get; set; }
//QueryEntry is a class derived from Microsoft.WindowsAzure.StorageClient.TableServiceEntity and it's composed by three string properties
}KeyValue and QueryEntry classes are in one project and IQueryService interface and QueryData are in another project.
I have two types of worker roles: slave and master. Slave perform a query and generate QueryData results. Slave worker role hosts the QueryService service in which Server worker role will connect to receive QueryData results. The communication between slave and master is working finelly. However an exception is thowed when master calls GetQueryData() method. The exception is:
[runtime] Unhandled Exception:
System.ServiceModel.CommunicationException: The socket connections was canceled. This can by caused by either message processing error or by received timeout exceeded by the remote host. The local socket timeout was '00:00:59.9359963'.---> System.Net.Sockets.SocketException:
It was forced to cancel an existing connection by the remote host
em System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
em System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
--- Fim do rastreamento de pilha de exceções internas ---Server stack trace:
em System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
em System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
em System.ServiceModel.Channels.DelegatingConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
em System.ServiceModel.Channels.SessionConnectionReader.Receive(TimeSpan timeout)
em System.ServiceModel.Channels.SynchronizedMessageSource.Receive(TimeSpan timeout)
em System.ServiceModel.Channels.FramingDuplexSessionChannel.Receive(TimeSpan timeout)
em System.ServiceModel.Channels.FramingDuplexSessionChannel.TryReceive(TimeSpan timeout, Message& message)
em System.ServiceModel.Dispatcher.DuplexChannelBinder.Request(Message message, TimeSpan timeout)
em System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
em System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
em System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
em System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)Exception rethrown at [0]:
em System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
em System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
em QueryServiceContract.IQueryService.GetQueryData()
em Master.WorkerRole.RetrieveAndSaveResults(Int32 federationMemberCount, String queryType) na D:\Projetos\VS\QueryESSB\Master\WorkerRole.cs:linha 158
em Master.WorkerRole.Run() na D:\Projetos\VS\QueryESSB\Master\WorkerRole.cs:linha 47
em Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.StartRoleInternal()
em Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.StartRole()
em Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.<StartRole>b__1()
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
em System.Threading.ThreadHelper.ThreadStart()So, can you help me?
Cheers.
Claudivan
כל התגובות
-
יום שני 30 יולי 2012 06:08
The connection seem to be rejected by service. Probably the request is not liked by the service due to some reason or it is taking long time to process the request.
One more thing i observed is, you are querity at the time of role start, if other role is not up running by the time you query it may lead to these results.
Can you switch WCF diagnotics on to see what exactly happening at service side?
Please mark the replies as Answered if they help and Vote if you found them helpful.- סומן כתשובה על-ידי Arwind - MSFTModerator יום שני 06 אוגוסט 2012 07:28
-
יום שני 06 אוגוסט 2012 11:07
Hi Veerendra, firstly, thanks for your help.
I already solve the problem. The data contract was incorrect between client and service. So, the connection was being rejected by service. All works fine when I fix the data contract!
Best regards.
Cheers []'s