When you state "client's implementation" are you referring to protobuf-net 
library itself? Or my application using protobug-net.

My client application is using single connection to server. But I run 
multiple instances(process) each having its own connection to same server.
As far as checking bytes I do not check bytes coming off wire they are 
being passed to protobuf-net library directly with out any modification.

And I catch such error I try to log all fields from marshaled protobuf-net 
library and I can say that some fields are correct and some are not. But 
again this problem only shows up when running multiple client on same 
machine.

Here is something very strange. There were some cases where one client get 
this error all clients stop updating across all client machines.
I did made sure by attaching server to gdb - > gcore file.core and check 
everything that there is no dead lock. And from what I can tell there no 
problem by inspecting all server threads.
At this point if I close each client server detects connection termination 
and loges of clients. If there would be some deadlock this would not be 
possible,

Logging back to server (with out restarting server) work just fine and 
things start working for some time.



On Saturday, March 23, 2013 1:00:46 PM UTC-5, Feng Xiao wrote:
>
> I think it's most likely a problem of your client's implementation where 
> it doesn't handle multiple connections correctly. Have you checked the 
> bytes you received on the client side?
> 在 2013-3-23 上午10:55,"oxoocoffee" <rjg...@gmail.com <javascript:>>写道:
>
>> Hello everyone,
>>
>> I have this very strange problem. Let me define what versions of 
>> protobuffers I am using (I tried combinations of them to see if there is 
>> something specific to specific version)
>>
>> protobuf-net - 1.0.0.280 (also tried latest protobuf-net r622.zip)
>> protobuf protobuf-2.4.1.tar.gz and protobuf-2.5.0.tar.gz
>>
>> In a nutshell I get corruption/missing data on dotnet side. Server always 
>> processes messages from client just fine and never a problem.
>>
>> Here is more details about setup and where things work and where they do 
>> not. Just so you know I am running tests all day everyday sending couple 
>> million messages a day.
>>
>> I have a application server ( C++/Linux/x64 ) and dotnet client 
>> application (Win7/Win8 x64). Multiple clients are connecting to server 
>> (same server). All clients are using the same version of protobuf-net.
>>
>> If I have one instance client running on single client machine all is 
>> good and there is no problems.
>> But in my lab if I want to test multiple clients running on the same 
>> physical machine I get some strange errors at random. I mean very random so 
>> it seams.
>>
>> Server is implemented that each client is handled by two threads (network 
>> reader and writer). Each client sender thread creates protobuf message on 
>> stack filling it with data and sending it to client.
>> I do check what is being send to client to file just to make sure all is 
>> ok (this is only enabled in DEBUG this problem). I have about 40 different 
>> types of protobuf messages. C++ and protobuf-net share same .proto file.
>>
>> So server pseudo code looks like this
>>
>> SendMessage( SomeInternamMessage ms)
>> {
>>      ProtoBufMessage_1 pbMsg;
>>
>>      
>>       pbMsg.set_field_1( ms.filed_1() );
>>       ........
>>       pbMsg.set_field_n( ms.filed_n() );
>>
>>       log( pbMsg ); // Log message to text file to check what is being 
>> set and send
>>
>>       SendMessage(pbMsg);
>> }
>>
>> Client on the other hand has a separate network reader thread reading 
>> messages and serializing protobuf-net messages calling events to pass data 
>> to UI. There is a check on all events checking for cross-threading calls 
>> and calling BeginInvoke when needed.
>>
>> Here is the strange part as I started to describe above. When running 
>> single client on single machine connecting to same server all works ok so 
>> it seams running continuously everyday.
>> When I start running 3-4 clients per client machine still connecting to 
>> same server I get once a while message on client from server that has 
>> invalid data. Not all but some members are invalid causing my application 
>> crash.
>>
>> Some of the fields that I see mostly bad/stale are DateTime or Int64 
>> values.
>>
>> I did check on server logs what was send and it looks correct not null or 
>> 0 where applicable and values are within proper range (not overflow on int 
>> types) So I know server is sending it correct.
>> I did go over the code few times to make sure Log() is not changing data 
>> on protobuf message and it is the only call between pack and send.
>>
>> Are there any protobuf error handlers or C++ and C# side that I can add 
>> to catch internal errors within each library to help me find out what is 
>> going on?
>>
>> At this point thing are looking like something with protobuf-net. But 
>> that is just a guess since server does not change (except rebuilding it 
>> against 2.4.1 or protobuf-2.5.0 for testing and isolating the case)
>>
>> Right now I am running  2.4.1 on server since it is more mature 
>> and 1.0.0.280  on client.
>>
>> Can any of the devs shad some light about internal protobuf-net dll and 
>> if there are any internal states that would have problem with sharing same 
>> dll against few running clients on same machine?
>>
>> Any help or suggestions is greatly appreciated.
>> If you need any extra info and what kind ... just ask..
>>
>> Thanx
>>
>>
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Protocol Buffers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to protobuf+u...@googlegroups.com <javascript:>.
>> To post to this group, send email to prot...@googlegroups.com<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/protobuf?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to