From f91254d26813f264aaacbee2f98e5464948c959b Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 25 Nov 2024 10:04:26 -0500 Subject: [PATCH] Logging in `WorkflowRun.LOADING_RUNS` --- .../java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java b/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java index dcce8d4c..deb05e16 100644 --- a/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java +++ b/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java @@ -547,6 +547,7 @@ private String key() { /** Hack to allow {@link #execution} to use an {@link Owner} referring to this run, even when it has not yet been loaded. */ @Override public void reload() throws IOException { + LOGGER.fine(() -> "Adding " + key() + " to LOADING_RUNS"); synchronized (LOADING_RUNS) { LOADING_RUNS.put(key(), this); } @@ -612,6 +613,7 @@ private String key() { } } finally { // Ensure the run is ALWAYS removed from loading even if something failed, so threads awaken. checkouts(null); // only for diagnostics + LOGGER.fine(() -> "Removing " + key() + " from LOADING_RUNS"); synchronized (LOADING_RUNS) { LOADING_RUNS.remove(key()); // or could just make the value type be WeakReference LOADING_RUNS.notifyAll();