chungen0126 commented on code in PR #10765:
URL: https://github.com/apache/ozone/pull/10765#discussion_r3596390024
##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockInputStream.java:
##########
@@ -518,15 +646,35 @@ private synchronized void storePosition() {
}
private void handleReadError(IOException cause) throws IOException {
- releaseClient();
- final List<ChunkInputStream> inputStreams = this.chunkStreams;
- if (inputStreams != null) {
- for (ChunkInputStream is : inputStreams) {
- is.releaseClient();
+ lock.lock();
+ try {
+ releaseClient();
+ final List<ChunkInputStream> inputStreams = this.chunkStreams;
+ if (inputStreams != null) {
+ for (ChunkInputStream is : inputStreams) {
+ is.releaseClient();
+ }
}
+ refreshBlockInfo(cause);
+ } finally {
+ lock.unlock();
}
+ }
- refreshBlockInfo(cause);
+ private void handlePositionReadError(IOException cause, Pipeline pipeline)
throws IOException {
+ lock.lock();
+ try {
+ releaseClient();
+ final List<ChunkInputStream> inputStreams = this.chunkStreams;
+ if (inputStreams != null) {
+ for (ChunkInputStream is : inputStreams) {
+ is.releaseClient();
Review Comment:
I don't think it's necessary. They didn't throw any exceptions.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]