slfan1989 opened a new pull request, #1447: URL: https://github.com/apache/ratis/pull/1447
## What changes were proposed in this pull request? This is a follow-up to RATIS-2501. RATIS-2501 added additional diagnostics for `testInstallSnapshotDuringBootstrap` failures. However, the diagnostic path may access raft log state from a peer whose raft log has already been closed. When this happens, `dumpClusterState()` can throw a secondary `IllegalStateException`, which hides the original failure that the diagnostics were intended to explain. This patch makes `dumpClusterState()` fail-safe by safely collecting diagnostic values. If a diagnostic value is unavailable, it is logged as `unavailable: <exception>` instead of throwing from the diagnostic path. ## What is the link to the Apache JIRA JIRA: RATIS-2518. Make testInstallSnapshotDuringBootstrap diagnostics fail-safe. ## How was this patch tested? Tested with: ``` ./mvnw -pl ratis-test -am -Pgrpc-tests -Dtest=TestInstallSnapshotNotificationWithGrpc#testInstallSnapshotDuringBootstrap test ``` Result: ``` [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] Running org.apache.ratis.grpc.TestInstallSnapshotNotificationWithGrpc [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.33 s - in org.apache.ratis.grpc.TestInstallSnapshotNotificationWithGrpc [INFO] [INFO] Results: [INFO] [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ ``` -- 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]
