Skip to content

Commit

Permalink
fix(s3stream): use thread safe data structures to prevent race condition
Browse files Browse the repository at this point in the history
Signed-off-by: Shichao Nie <[email protected]>
  • Loading branch information
SCNieh committed Mar 27, 2024
1 parent 46ccc8a commit 2df2a9e
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
import io.opentelemetry.instrumentation.annotations.WithSpan;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -555,8 +553,8 @@ public ReadContext(long startOffset, int maxBytes) {
this.objects = new LinkedList<>();
this.objectIndex = 0;
this.streamDataBlocksPair = new LinkedList<>();
this.objectReaderMap = new HashMap<>();
this.taskKeySet = new HashSet<>();
this.objectReaderMap = new ConcurrentHashMap<>();
this.taskKeySet = ConcurrentHashMap.newKeySet();
this.nextStartOffset = startOffset;
this.nextMaxBytes = maxBytes;
this.timer = new TimerUtil();
Expand Down

0 comments on commit 2df2a9e

Please sign in to comment.