From 4062bd31a79405f3da034c49b38cd20e6555428a Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 4 Oct 2019 15:26:21 -0400 Subject: [PATCH] Utils.waitUntilReady should record the stack trace of the caller before rethrowing an exception. --- CHANGELOG.md | 1 + .../main/java/io/fabric8/kubernetes/client/utils/Utils.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62e727d5f19..a8bac213892 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Fix #1782: Informer Deadlock; Fix lock typo in SharedProcessor #### Improvements +* Fix #1797: Utils.waitUntilReady should record the stack trace of the caller before rethrowing an exception * Add support for filtering labels by EXISTS/NOT_EXISTS via the single argument versions of `.withLabel` and `.withoutLabel` * Schedule reconnect in case of HTTP_GONE when watching; the rescheduled connect will start from beginning of history by not specifying resourceVersion #### Dependency Upgrade diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/Utils.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/Utils.java index 30c95f39e05..d64e0fd639b 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/Utils.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/Utils.java @@ -130,7 +130,9 @@ public static boolean waitUntilReady(BlockingQueue queue, long amount, T if (obj instanceof Boolean) { return (Boolean) obj; } else if (obj instanceof Throwable) { - throw (Throwable) obj; + Throwable t = (Throwable) obj; + t.addSuppressed(new Throwable("waiting here")); + throw t; } return false; } catch (Throwable t) {