I’m writing my own NetBeans plugin for Gradle. Today I’ve tried to upgrade the tooling API from 2.12 to 2.13 (usually it is painless replacing jars.) Though I see something “strange” now.
Some background: NetBeans executes task in separate thread groups and marks task finished when all the threads are finished in the group. I have the following flow (simplified):
I could create a minimalistic sample project to reproduce the issue: https://github.com/lkishalmi/gradle-thread-leak
So this happens only with Gradle 2.13 and setColoredOutput(true) on BuildLauncher. It seems to be completely independent from the used tooling API (so using 2.12 tooling API and requesting 2.13 Gradle execution reveals this problem).
Thanks, I thought it could be something related to that area.
I’m not completely familiar with that area of the code, but one question I have with timing out the console renderer thread is if it might cause a perverse create-thread, render, destroy-thread, create-thread, render… cycle when there’s very little output. Potentially the executor needs to be tied into a service that’s stopped when the build stops.