This is an automated email from the ASF dual-hosted git repository.

umamahesh pushed a commit to branch HDDS-3816-ec
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/HDDS-3816-ec by this push:
     new 0a83e70  HDDS-6341: EC: Fix the race condition in 
TestECBlockReconstructedStripeInputStream. (#3111)
0a83e70 is described below

commit 0a83e7018ebea3142a2885bb4ecf80278c41f017
Author: Uma Maheswara Rao G <[email protected]>
AuthorDate: Tue Feb 22 13:19:35 2022 -0800

    HDDS-6341: EC: Fix the race condition in 
TestECBlockReconstructedStripeInputStream. (#3111)
---
 .../hadoop/ozone/client/rpc/read/ECStreamTestUtil.java       | 12 +++++++-----
 .../hadoop/ozone/client/rpc/read/TestECBlockInputStream.java | 10 +++++-----
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/ECStreamTestUtil.java
 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/ECStreamTestUtil.java
index 5658cdc..b770d42 100644
--- 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/ECStreamTestUtil.java
+++ 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/ECStreamTestUtil.java
@@ -225,23 +225,25 @@ public final class ECStreamTestUtil {
 
     private Pipeline currentPipeline;
 
-    public List<ECStreamTestUtil.TestBlockInputStream> getBlockStreams() {
+    public synchronized
+        List<ECStreamTestUtil.TestBlockInputStream> getBlockStreams() {
       return blockStreams;
     }
 
-    public void setBlockStreamData(List<ByteBuffer> bufs) {
+    public synchronized void setBlockStreamData(List<ByteBuffer> bufs) {
       this.blockStreamData = bufs;
     }
 
-    public void setCurrentPipeline(Pipeline pipeline) {
+    public synchronized void setCurrentPipeline(Pipeline pipeline) {
       this.currentPipeline = pipeline;
     }
 
-    public void setFailIndexes(List<Integer> fail) {
+    public synchronized void setFailIndexes(List<Integer> fail) {
       failIndexes.addAll(fail);
     }
 
-    public BlockExtendedInputStream create(ReplicationConfig repConfig,
+    public synchronized BlockExtendedInputStream create(
+        ReplicationConfig repConfig,
         OmKeyLocationInfo blockInfo, Pipeline pipeline,
         Token<OzoneBlockTokenIdentifier> token, boolean verifyChecksum,
         XceiverClientFactory xceiverFactory,
diff --git 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockInputStream.java
 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockInputStream.java
index b3b01ba4..17a0a6f 100644
--- 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockInputStream.java
+++ 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockInputStream.java
@@ -412,14 +412,14 @@ public class TestECBlockInputStream {
 
     private List<TestBlockInputStream> blockStreams = new ArrayList<>();
 
-    public List<TestBlockInputStream> getBlockStreams() {
+    public synchronized List<TestBlockInputStream> getBlockStreams() {
       return blockStreams;
     }
 
-    public BlockExtendedInputStream create(ReplicationConfig repConfig,
-        OmKeyLocationInfo blockInfo, Pipeline pipeline,
-        Token<OzoneBlockTokenIdentifier> token, boolean verifyChecksum,
-        XceiverClientFactory xceiverFactory,
+    public synchronized BlockExtendedInputStream create(
+        ReplicationConfig repConfig, OmKeyLocationInfo blockInfo,
+        Pipeline pipeline, Token<OzoneBlockTokenIdentifier> token,
+        boolean verifyChecksum, XceiverClientFactory xceiverFactory,
         Function<BlockID, Pipeline> refreshFunction) {
       TestBlockInputStream stream = new TestBlockInputStream(
           blockInfo.getBlockID(), blockInfo.getLength(),

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

Reply via email to