jojochuang commented on PR #6413:
URL: https://github.com/apache/ozone/pull/6413#issuecomment-2037974785
TestHSync.testConcurrentWriteHSync() has an error, but we need to let it
catch&throw IllegalArgumentException too.
Suggest to apply this patch and you'll see the exception:
```
diff --git
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestHSync.java
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestHSync.java
index 1050b5b48b..0e2c05c104 100644
---
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestHSync.java
+++
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestHSync.java
@@ -578,7 +578,7 @@ private void runConcurrentWriteHSync(Path file,
try {
out.write(data);
} catch (IOException e) {
- writerException.set(e);
+ writerException.set(new IOException(e));
throw new RuntimeException(e);
}
}
@@ -588,8 +588,8 @@ private void runConcurrentWriteHSync(Path file,
while ((Time.monotonicNow() - start < 10000)) {
try {
out.hsync();
- } catch (IOException e) {
- syncerException.set(e);
+ } catch (Throwable e) {
+ syncerException.set(new IOException(e));
throw new RuntimeException(e);
}
}
```
Apply this patch to address the bug:
```
diff --git
a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/BlockOutputStreamEntryPool.java
b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/BlockOutputStreamEntryPool.java
index 1b7918a45a..ed1d149dd5 100644
---
a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/BlockOutputStreamEntryPool.java
+++
b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/BlockOutputStreamEntryPool.java
@@ -338,10 +338,10 @@ void commitKey(long offset) throws IOException {
void hsyncKey(long offset) throws IOException {
if (keyArgs != null) {
// in test, this could be null
- long length = getKeyLength();
- Preconditions.checkArgument(offset == length,
- "Expected offset: " + offset + " expected len: " + length);
- keyArgs.setDataSize(length);
+ //long length = getKeyLength();
+ //Preconditions.checkArgument(offset == length,
+ // "Expected offset: " + offset + " expected len: " + length);
+ keyArgs.setDataSize(offset);
keyArgs.setLocationInfoList(getLocationInfoList());
// When the key is multipart upload part file upload, we should not
// commit the key, as this is not an actual key, this is a just a
```
--
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]