Another approach, I think the best candidate, but it requires fixing Jenkins core: I’m pondering whether we could solve the problem of so many QueueSubTaskMetrics threads waiting by ensuring the synchronizeEnd and synchronizeStart always set the future? For example by surrounding the code of these two methods with try-catch and setting the future in the finally clause before rethrowing the exception. I think this because if an exception is thrown in these methods, the result is not set, so the thread is always waiting because the complete flag is not set. WorkUnitContext.java#L132 But this is a fix on Jenkins core, not in Metrics plugin. |