[ 
https://issues.apache.org/jira/browse/HDDS-1372?focusedWorklogId=223111&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-223111
 ]

ASF GitHub Bot logged work on HDDS-1372:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Apr/19 17:07
            Start Date: 04/Apr/19 17:07
    Worklog Time Spent: 10m 
      Work Description: mukul1987 commented on pull request #682: HDDS-1372. 
getContainerWithPipeline for a standalone pipeline fails with 
ConcurrentModificationException.
URL: https://github.com/apache/hadoop/pull/682#discussion_r272278218
 
 

 ##########
 File path: 
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/TestSCMContainerManager.java
 ##########
 @@ -194,6 +197,49 @@ public void testGetContainerWithPipeline() throws 
Exception {
     Assert.assertTrue(replicaNodes.contains(dn1));
   }
 
+  @Test
+  public void testGetContainerReplicaWithParallelUpdate() throws Exception {
+    testGetContainerWithPipeline();
+    final Optional<ContainerID> id = containerManager.getContainerIDs()
+        .stream().findFirst();
+    Assert.assertTrue(id.isPresent());
+    final ContainerID cId = id.get();
+    final Optional<ContainerReplica> replica = containerManager
+        .getContainerReplicas(cId).stream().findFirst();
+    Assert.assertTrue(replica.isPresent());
+    final ContainerReplica cReplica = replica.get();
+    final AtomicBoolean runUpdaterThread =
+        new AtomicBoolean(true);
+
+    Thread updaterThread = new Thread(() -> {
+      while (runUpdaterThread.get()) {
+        try {
+          containerManager.removeContainerReplica(cId, cReplica);
+          containerManager.updateContainerReplica(cId, cReplica);
+        } catch (ContainerNotFoundException e) {
+          e.printStackTrace();
 
 Review comment:
   This should be changed to an Assert
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 223111)
    Time Spent: 0.5h  (was: 20m)

> getContainerWithPipeline for a standalone pipeline fails with 
> ConcurrentModificationException
> ---------------------------------------------------------------------------------------------
>
>                 Key: HDDS-1372
>                 URL: https://issues.apache.org/jira/browse/HDDS-1372
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>          Components: SCM
>    Affects Versions: 0.5.0
>            Reporter: Mukul Kumar Singh
>            Assignee: Nanda kumar
>            Priority: Major
>              Labels: MiniOzoneChaosCluster, pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The excception is hit while fetching a pipeline during read.
> {code}
> 2019-04-03 00:52:50,125 WARN  ipc.Server (Server.java:logException(2724)) - 
> IPC Server handler 16 on 59758, call Call#2270 Retry#0 
> org.apache.hadoop.hdds.scm.protocol.StorageContainerLocationProtocol.getC
> ontainerWithPipeline from 192.168.0.108:60011
> java.util.ConcurrentModificationException
>         at 
> java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1558)
>         at 
> java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
>         at 
> java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
>         at 
> java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
>         at 
> java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
>         at 
> java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
>         at 
> org.apache.hadoop.hdds.scm.server.SCMClientProtocolServer.getContainerWithPipeline(SCMClientProtocolServer.java:252)
>         at 
> org.apache.hadoop.ozone.protocolPB.StorageContainerLocationProtocolServerSideTranslatorPB.getContainerWithPipeline(StorageContainerLocationProtocolServerSideTranslatorPB.java:144)
>         at 
> org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos$StorageContainerLocationProtocolService$2.callBlockingMethod(StorageContainerLocationProtocolProtos.java:16390)
>         at 
> org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:524)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:1025)
>         at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:876)
>         at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:822)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at javax.security.auth.Subject.doAs(Subject.java:422)
>         at 
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1730)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2682)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to