Skip to content

Commit 1783582

Browse files
committed
Remove unnecessary shouldRetry variable in DFSOutputStream
Signed-off-by: Kaijie Chen <[email protected]>
1 parent 697e5d4 commit 1783582

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSOutputStream.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,8 @@ static DFSOutputStream newStreamForCreate(DFSClient dfsClient, String src,
275275

276276
// Retry the create if we get a RetryStartFileException up to a maximum
277277
// number of times
278-
boolean shouldRetry = true;
279278
int retryCount = CREATE_RETRY_COUNT;
280-
while (shouldRetry) {
281-
shouldRetry = false;
279+
while (true) {
282280
try {
283281
stat = dfsClient.namenode.create(src, masked, dfsClient.clientName,
284282
new EnumSetWritable<>(flag), createParent, replication,
@@ -301,7 +299,6 @@ static DFSOutputStream newStreamForCreate(DFSClient dfsClient, String src,
301299
UnknownCryptoProtocolVersionException.class);
302300
if (e instanceof RetryStartFileException) {
303301
if (retryCount > 0) {
304-
shouldRetry = true;
305302
retryCount--;
306303
} else {
307304
throw new IOException("Too many retries because of encryption" +

0 commit comments

Comments
 (0)