You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Kashyap Mhaisekar <ka...@gmail.com> on 2015/09/18 00:46:11 UTC

Concurrent Modification Exception & Thread safety of bolt

Hi,
I keep getting Concurrent Modification Exceptions in one of my bolts and it
happens at times. All the emitted fields are strings and one is an object
that I cast from incoming tuple.

How to figure out which field is getting modified elsewhere?
Also, are bolts and its instance variables inherently thread safe?

Thanks
Kashyap

Re: Concurrent Modification Exception & Thread safety of bolt

Posted by Kashyap Mhaisekar <ka...@gmail.com>.
Thanks Florian. Is there a way to know which emitted filed is being
modified in someother bolt?

On Thu, Sep 17, 2015 at 6:05 PM, Florian Hussonnois <fh...@gmail.com>
wrote:

> Hi,
>
> Tuples that are emitted to bolts into the same worker are not serialized.
> In this case, the object which is passed into the tuple may be manipulate
> by differents bolts if the instance is shared.
> You should emit immutable objets into tuples.
>
> A bolt is always executed by a single thread at time.
>
> 2015-09-18 0:46 GMT+02:00 Kashyap Mhaisekar <ka...@gmail.com>:
>
>> Hi,
>> I keep getting Concurrent Modification Exceptions in one of my bolts and
>> it happens at times. All the emitted fields are strings and one is an
>> object that I cast from incoming tuple.
>>
>> How to figure out which field is getting modified elsewhere?
>> Also, are bolts and its instance variables inherently thread safe?
>>
>> Thanks
>> Kashyap
>>
>
>
>
> --
> Florian HUSSONNOIS
>

Re: Concurrent Modification Exception & Thread safety of bolt

Posted by Florian Hussonnois <fh...@gmail.com>.
Hi,

Tuples that are emitted to bolts into the same worker are not serialized.
In this case, the object which is passed into the tuple may be manipulate
by differents bolts if the instance is shared.
You should emit immutable objets into tuples.

A bolt is always executed by a single thread at time.

2015-09-18 0:46 GMT+02:00 Kashyap Mhaisekar <ka...@gmail.com>:

> Hi,
> I keep getting Concurrent Modification Exceptions in one of my bolts and
> it happens at times. All the emitted fields are strings and one is an
> object that I cast from incoming tuple.
>
> How to figure out which field is getting modified elsewhere?
> Also, are bolts and its instance variables inherently thread safe?
>
> Thanks
> Kashyap
>



-- 
Florian HUSSONNOIS