YARN-8106. Update LogAggregationIndexedFileController to use readFull instead read to avoid IOException while loading log meta. (Prabhu Joseph via wangda)

Change-Id: I63a65f73f8d1636e2c99ed9c8c2bbd05efcff80f
This commit is contained in:
Wangda Tan 2018-04-03 21:06:24 -07:00
parent f7a17b029d
commit b779f4f0f6
1 changed files with 2 additions and 1 deletions

View File

@ -865,7 +865,8 @@ public class LogAggregationIndexedFileController
byte[] array = new byte[offset];
fsDataIStream.seek(
fileLength - offset - Integer.SIZE/ Byte.SIZE - UUID_LENGTH);
int actual = fsDataIStream.read(array);
fsDataIStream.readFully(array);
int actual = array.length;
if (actual != offset) {
throw new IOException("Error on loading log meta from "
+ remoteLogPath);