Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-15573

State transfer can fail due to ConcurrentModificationException if distributed web session attributes are concurrently modified

XMLWordPrintable

      Affects SESSION granularity using REPEATABLE_READ transactional cache.

      Coarse granularity distributed web session store attributes within a HashMap and rely on write locking of the session creation meta data entry to prevent concurrent modification. However, this does not prevent state transfer from marshalling the session attributes entry. To fix, we should require write locks on the session attributes entry as well.

      2021-10-18 20:20:16,081 ERROR [org.infinispan.remoting.rpc.RpcManagerImpl] (transport-thread--p6-t17) ISPN000073: Unexpected error while replicating: java.util.ConcurrentModificationException
          at java.util.HashMap$HashIterator.nextNode(HashMap.java:1445)
          at java.util.HashMap$EntryIterator.next(HashMap.java:1479)
          at java.util.HashMap$EntryIterator.next(HashMap.java:1477)
          at org.wildfly.clustering.marshalling.spi.util.MapExternalizer.writeMap(MapExternalizer.java:56)
          at org.wildfly.clustering.marshalling.spi.util.MapExternalizer.writeObject(MapExternalizer.java:51)
          at org.wildfly.clustering.marshalling.spi.util.MapExternalizer.writeObject(MapExternalizer.java:38)
          at org.wildfly.clustering.marshalling.spi.DefaultExternalizer.writeObject(DefaultExternalizer.java:179)
          at org.wildfly.clustering.marshalling.jboss.ExternalizerObjectTable$ExternalizerWriter.writeObject(ExternalizerObjectTable.java:126)
          at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:137)
          at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:58)
          at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:111)
          at org.wildfly.clustering.marshalling.jboss.SimpleMarshalledValue.getBytes(SimpleMarshalledValue.java:78)
          at org.wildfly.clustering.marshalling.jboss.SimpleMarshalledValueExternalizer.writeObject(SimpleMarshalledValueExternalizer.java:51)
          at org.wildfly.clustering.marshalling.jboss.SimpleMarshalledValueExternalizer.writeObject(SimpleMarshalledValueExternalizer.java:36)
          at org.wildfly.clustering.marshalling.infinispan.AdvancedExternalizerAdapter.writeObject(AdvancedExternalizerAdapter.java:51)
          at org.infinispan.marshall.core.ExternalExternalizers$ForeignAdvancedExternalizer.writeObject(ExternalExternalizers.java:78)
          at org.infinispan.marshall.core.GlobalMarshaller.writeExternal(GlobalMarshaller.java:652)
          at org.infinispan.marshall.core.GlobalMarshaller.writeNonNullableObject(GlobalMarshaller.java:406)
          at org.infinispan.marshall.core.GlobalMarshaller.writeNullableObject(GlobalMarshaller.java:355)
          at org.infinispan.marshall.core.BytesObjectOutput.writeObject(BytesObjectOutput.java:26)
          at org.infinispan.container.entries.ImmortalCacheEntry$Externalizer.writeObject(ImmortalCacheEntry.java:126)
          at org.infinispan.container.entries.ImmortalCacheEntry$Externalizer.writeObject(ImmortalCacheEntry.java:122)
          at org.infinispan.marshall.core.GlobalMarshaller.writeInternal(GlobalMarshaller.java:638)
          at org.infinispan.marshall.core.GlobalMarshaller.writeNonNullableObject(GlobalMarshaller.java:402)
          at org.infinispan.marshall.core.GlobalMarshaller.writeNullableObject(GlobalMarshaller.java:355)
          at org.infinispan.marshall.core.BytesObjectOutput.writeObject(BytesObjectOutput.java:26)
          at org.infinispan.commons.marshall.MarshallUtil.marshallCollection(MarshallUtil.java:243)
          at org.infinispan.commons.marshall.MarshallUtil.marshallCollection(MarshallUtil.java:221)
          at org.infinispan.marshall.exts.CollectionExternalizer.writeObject(CollectionExternalizer.java:75)
          at org.infinispan.marshall.exts.CollectionExternalizer.writeObject(CollectionExternalizer.java:27)
          at org.infinispan.marshall.core.GlobalMarshaller.writeInternal(GlobalMarshaller.java:638)
          at org.infinispan.marshall.core.GlobalMarshaller.writeNonNullableObject(GlobalMarshaller.java:402)
          at org.infinispan.marshall.core.GlobalMarshaller.writeNullableObject(GlobalMarshaller.java:355)
          at org.infinispan.marshall.core.BytesObjectOutput.writeObject(BytesObjectOutput.java:26)
          at org.infinispan.statetransfer.StateChunk$Externalizer.writeObject(StateChunk.java:80)
          at org.infinispan.statetransfer.StateChunk$Externalizer.writeObject(StateChunk.java:65)
          at org.infinispan.marshall.core.GlobalMarshaller.writeInternal(GlobalMarshaller.java:638)
          at org.infinispan.marshall.core.GlobalMarshaller.writeNonNullableObject(GlobalMarshaller.java:402)
          at org.infinispan.marshall.core.GlobalMarshaller.writeNullableObject(GlobalMarshaller.java:355)
          at org.infinispan.marshall.core.BytesObjectOutput.writeObject(BytesObjectOutput.java:26)
          at org.infinispan.commons.marshall.MarshallUtil.marshallCollection(MarshallUtil.java:243)
          at org.infinispan.commons.marshall.MarshallUtil.marshallCollection(MarshallUtil.java:221)
          at org.infinispan.statetransfer.StateResponseCommand.writeTo(StateResponseCommand.java:131)
          at org.infinispan.marshall.exts.ReplicableCommandExternalizer.writeCommandParameters(ReplicableCommandExternalizer.java:71)
          at org.infinispan.marshall.exts.CacheRpcCommandExternalizer.marshallParameters(CacheRpcCommandExternalizer.java:121)
          at org.infinispan.marshall.exts.CacheRpcCommandExternalizer.writeObject(CacheRpcCommandExternalizer.java:117)
          at org.infinispan.marshall.exts.CacheRpcCommandExternalizer.writeObject(CacheRpcCommandExternalizer.java:67)
          at org.infinispan.marshall.core.GlobalMarshaller.writeInternal(GlobalMarshaller.java:638)
          at org.infinispan.marshall.core.GlobalMarshaller.writeNonNullableObject(GlobalMarshaller.java:402)
          at org.infinispan.marshall.core.GlobalMarshaller.writeNullableObject(GlobalMarshaller.java:355)
          at org.infinispan.marshall.core.GlobalMarshaller.writeObjectOutput(GlobalMarshaller.java:183)
          at org.infinispan.marshall.core.GlobalMarshaller.writeObjectOutput(GlobalMarshaller.java:176)
          at org.infinispan.marshall.core.GlobalMarshaller.objectToBuffer(GlobalMarshaller.java:305)
          at org.infinispan.remoting.transport.jgroups.JGroupsTransport.marshallRequest(JGroupsTransport.java:1007)
          at org.infinispan.remoting.transport.jgroups.JGroupsTransport.sendCommand(JGroupsTransport.java:990)
          at org.infinispan.remoting.transport.jgroups.JGroupsTransport.invokeCommand(JGroupsTransport.java:826)
          at org.infinispan.remoting.transport.jgroups.JGroupsTransport.performSyncRemoteInvocation(JGroupsTransport.java:1120)
          at org.infinispan.remoting.transport.jgroups.JGroupsTransport.invokeRemotelyAsync(JGroupsTransport.java:249)
          at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotelyAsync(RpcManagerImpl.java:291)
          at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:323)
          at org.infinispan.statetransfer.OutboundTransferTask.sendEntries(OutboundTransferTask.java:266)
          at org.infinispan.statetransfer.OutboundTransferTask.run(OutboundTransferTask.java:205)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at org.wildfly.clustering.service.concurrent.ClassLoaderThreadFactory.lambda$newThread$0(ClassLoaderThreadFactory.java:47)
          at java.lang.Thread.run(Thread.java:748)
      Caused by: an exception which occurred:
          in object java.util.HashMap@7f3d222
      

              pferraro@redhat.com Paul Ferraro
              pferraro@redhat.com Paul Ferraro
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: