Home > .net > ProfoBuf.Net: Unknown wire-type 7

ProfoBuf.Net: Unknown wire-type 7

I’d been making changes all day to this winforms app to improve performance and handle edge cases. All of a sudden, I started getting the following exception from ProtoBuf.Net

Type: ProtoException
Message: Unknown wire-type 7
Source: TIBCO.Rendezvous
at TIBCO.Rendezvous.Queue.TimedDispatch(Double timeout)
at TIBCO.Rendezvous.Queue.Dispatch()
at TIBCO.Rendezvous.Dispatcher.run()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

You can actually see the ProtoBuf.Net code right here.

I came across this exception once several months ago and couldn’t figure out the cause then. At least this time, I knew what code had changed, but tracking the cause down was still a bit painful.

As it turned out, the app was making 2 TIBCO calls to the server for data request for the same object (hence the same response by the server). I’m guessing some deserialization code along the way tripped over itself working with the native object with 2 concurrent identical calls.

The fact that the app heavily uses events from multiple classes (ugh!) to accomplish 1 data flow made it hard to isolate the code. Added to that, the exception would only be thrown when running the debug build outside the VS ide.

So, if you receive this exception, check what the server is sending you first to see if the protobuf object would, in fact, be duplicate on the 2nd response.

Categories: .net Tags:
  1. August 6, 2009 at 6:21 pm

    I wasn’t sure (from the above) whether you managed to resolve this; if not, feel free to drop me a line, by e-mail, on “stackoverflow”, or log an issue on the project site.

    Marc Gravell (author, protobuf-net)

  2. devrandom1
    August 6, 2009 at 6:24 pm


    Yes, I was able to resolve this issue by not sending the 2nd command. But it’s possible that there’s a bug there when ProtoBuf is wrapped inside a native object in the use case of duplicate simultaneous messages.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: