cmccabe commented on PR #14369:
URL: https://github.com/apache/kafka/pull/14369#issuecomment-1809242988

   I don't know if we want to do this in this PR, but one thing I would suggest 
for ReplicaManager is to use the `FaultHandler` paradigm we have in the 
`QuorumController` code.
   
   Specifically, when `QuorumController` hits an unrecoverable condition it 
will invoke the `FaultHandler`. In normal operation this maps to logging an 
error message and exiting. In unit tests, it maps to an exception, and also 
setting a flag that will cause any integration test to always fail.
   
   This accomplishes two things:
   1. avoids calling `exit(1)` in junit tests, which will kill Jenkins dead 
(even after 3 decades of Java, we don't have the technology to intercept 
`exit()` in unit testrs >:( )
   2. allows us to always know if something is going wrong in the unit / 
integration test.
   
   There can also be non-fatal fault handlers, which tend to make point 2 even 
more important (since many times throwing an exception or logging an ERROR will 
not prevent the test from succeeding!)


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