kevin-wu24 commented on code in PR #20707:
URL: https://github.com/apache/kafka/pull/20707#discussion_r2578454870


##########
metadata/src/test/java/org/apache/kafka/metadata/storage/FormatterTest.java:
##########
@@ -168,9 +183,9 @@ public void testFormatterFailsOnUnwritableDirectory() 
throws Exception {
         try (TestEnv testEnv = new TestEnv(1)) {
             new File(testEnv.directory(0)).setReadOnly();
             FormatterContext formatter1 = testEnv.newFormatter();
-            String expectedPrefix = "Error while writing meta.properties file";
+            String expectedPrefix = "Error creating temporary file, logDir =";
             assertEquals(expectedPrefix,
-                assertThrows(FormatterException.class,
+                assertThrows(UncheckedIOException.class,

Review Comment:
   I don't think setting the `WriteErrorHandler` ahead of setting the 
`PreWriteHandler` will do anything. The latter code executes before writing 
`meta.properties`.
   
   I think what we want to do is to catch `IOException` and wrap it into a 
`FormatterException` if we are unable to write the `0-0.checkpoint` file.



-- 
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]

Reply via email to