From d4a636fd3ec64d11172fbdd6a142c0a8432d69ba Mon Sep 17 00:00:00 2001 From: Denghui Dong Date: Mon, 2 Mar 2020 12:59:31 +0800 Subject: [PATCH] [Backport] 8234059: Stress test fails with "Unexpected Exception in thread JFR Event Stream" Summary: Test Plan: jdk/jfr Reviewed-by: yuleil Issue: https://github.com/alibaba/dragonwell8/issues/112 --- .../jdk/jfr/internal/consumer/ConstantMap.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/share/classes/jdk/jfr/internal/consumer/ConstantMap.java b/src/share/classes/jdk/jfr/internal/consumer/ConstantMap.java index c45b80574..cd5415f44 100644 --- a/src/share/classes/jdk/jfr/internal/consumer/ConstantMap.java +++ b/src/share/classes/jdk/jfr/internal/consumer/ConstantMap.java @@ -25,6 +25,10 @@ package jdk.jfr.internal.consumer; +import jdk.jfr.internal.LogLevel; +import jdk.jfr.internal.LogTag; +import jdk.jfr.internal.Logger; + import jdk.jfr.internal.LongMap; /** @@ -90,14 +94,14 @@ final class ConstantMap { return new Reference(this, id); } - // should always have a value + // should ideally always have a value Object value = objects.get(id); if (value == null) { - // unless is 0 which is used to represent null - if (id == 0) { - return null; + // unless id is 0 which is used to represent null + if (id != 0) { + Logger.log(LogTag.JFR_SYSTEM_PARSER, LogLevel.INFO, "Missing object id=" + id + " in pool " + name + ". All ids should reference an object"); } - throw new InternalError("Missing object id=" + id + " in pool " + name + ". All ids should reference object"); + return null; } // id is resolved (but not the whole pool) -- GitLab