RFR: 8287312: G1: Early return on first failure in VerifyRegionClosure

Thomas Schatzl tschatzl at openjdk.java.net
Mon May 30 13:00:36 UTC 2022


On Mon, 30 May 2022 12:22:18 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> Open/Closed-region verifiers use `guarantee` -- it crashes on failure. There is indeed some inconsistency: other regions verifers report the status back to the caller. Such inconsistency also exists at the top-level caller `G1HeapVerifier::verify`.
> 
> For unification, I believe using `guarantee` and discarding the "out parameter" would be cleaner, with the potential drawback of printing too little info on failure. However, when failure does occur during verification, some domain-specific knowledge is required to resolve it, so blindly printing all info is not always necessarily helpful.

Note that there is some use of printing some erroneous objects - a dev might glean some information on whether a particular class of objects is affected; there is not much point in printing all errors for all regions though. Also for  reasons it's sometimes easier to look at failures for some classes than others.

There is `G1MaxVerifyFailures` after all, but it's not implemented consistently.

So I'm not really convinced that a `guarantee` is best, but of course it depends. Since the guarantees are pre-existing I'll mark this as reviewed.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8882



More information about the hotspot-gc-dev mailing list