On 01/15/2013 04:00 PM, Feng Xiao wrote:
> Protobuf messages are thread-compatible. You can read a protobuf message 
> concurrently in multiple threads. But if you need to update it at the same 
> time, all threads must acquire a lock before accessing or updating the 
> message.

Thanks, that's what I would have expected. But do you see a reason for
the error below under these assumptions?

Kind regards,

> On Tuesday, January 15, 2013 7:45:35 PM UTC+8, Johannes Wienke wrote:
>> The reason I am asking is that we receive an exception in one of our 
>> systems where actually two threads are operating on a message in parallel. 
>> One prints out the whole message and the other one reads some attributes 
>> from the message. The printing thread consistently crashes with the 
>> following backtrace:
>>   File 
>> "/vol/humavips/releases/y3demo/lib/python2.7/site-packages/rsb_python-0.7.0-py2.7.egg/rsb/util.py",
>>  line 252, in push
>>     self.__logger.debug("Got new message to dispatch: %s" % message)
>>   File 
>> "/vol/humavips/releases/y3demo/lib/python2.7/site-packages/rsb_python-0.7.0-py2.7.egg/rsb/__init__.py",
>>  line 1068, in __str__
>>     % ("Event", self.__id, self.__scope, printData, self.__type, 
>> self.__metaData, self.__causes)
>>   File 
>> "/usr/lib/python2.7/dist-packages/google/protobuf/internal/python_message.py",
>>  line 660, in __str__
>>     return text_format.MessageToString(self)
>>   File "/usr/lib/python2.7/dist-packages/google/protobuf/text_format.py", 
>> line 58, in MessageToString
>>     PrintMessage(message, out, as_utf8=as_utf8, as_one_line=as_one_line)
>>   File "/usr/lib/python2.7/dist-packages/google/protobuf/text_format.py", 
>> line 67, in PrintMessage
>>     for field, value in message.ListFields():
>>   File 
>> "/usr/lib/python2.7/dist-packages/google/protobuf/internal/python_message.py",
>>  line 554, in ListFields
>>     all_fields = [item for item in self._fields.iteritems() if 
>> _IsPresent(item)]
>> RuntimeError: dictionary changed size during iteration

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to