mirror of https://github.com/sbt/sbt.git
While dogfooding the latest sbt, I noticed that sometimes the watch input threads leak. I suspect this happens when a build is immediately triggered by a file that was modified during compilation. Though I didn't fully verify this, it's likely that we interrupted the input reading thread before it actually started reading. When it started reading after the interrupt, it would block until the user entered another input character. The result was that the zombie thread would effectively steal the next character from the input stream which manifested as the first character being ignored when the user tried to enter a watch input option. If more than one thread leaked, then it may take a number of keystrokes before the user regained control. To fix this, we can ensure that all watch related threads are joined before we exit watch. To avoid completely blocking the ui, we only try to join the threads for a second and print an error if the join fails. This shouldn't be the case so if users see this error, then we need to fix the bug. |
||
|---|---|---|
| .. | ||
| src | ||
| NOTICE | ||