When LifecycleTransaction is used in a multi-threaded context, we encounter this exception -
During streaming we create a reference to a LifeCycleTransaction and share it between threads -
This is used in a multi-threaded context inside CassandraIncomingFile which is an IncomingStreamMessage. This is being deserialized in parallel.
LifecycleTransaction is not meant to be used in a multi-threaded context and this leads to streaming failures due to object sharing. On trunk, this object is shared across all threads that transfer sstables in parallel for the given TableId in a StreamSession. There are two options to solve this - make LifecycleTransaction and the associated objects thread safe, scope the transaction to a single CassandraIncomingFile. The consequences of the latter option is that if we experience streaming failure we may have redundant SSTables on disk. This is ok as compaction should clean this up. A third option is we synchronize access in the streaming infrastructure.