FELIX-6759 Follow-up: Replace Thread.stop() with interrupt() in configadmin UpdateThread - #556
FELIX-6759 Follow-up: Replace Thread.stop() with interrupt() in configadmin UpdateThread#556paulrutter wants to merge 10 commits into
Conversation
UpdateThread.terminate() falls back to killing the worker when it fails to join
within 5 seconds:
Log.logger.log( LogService.LOG_ERROR,
"Worker thread {0} did not terminate within 5 seconds; trying to kill", ... );
workerThread.stop();
Thread.stop() has thrown UnsupportedOperationException unconditionally since Java 20,
so on any recent JDK that path can only turn a slow shutdown into a failed one: the
exception propagates out of terminate() instead of the thread being stopped.
It now interrupts the worker, which is the supported mechanism and releases the
thread if it is waiting on an interruptible operation. The javadoc and the log
message are updated to match.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
configadmin is not in the workflow's path filters, so a pull request touching only configadmin matches no trigger and gets no build at all. This change would otherwise go in unverified. Adds it to both triggers, to the paths-filter, and as a build step. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This reverts commit 45f6d17.
|
Restacked onto #555 and narrowed to just the code fix. CI could not build this: That build repair belongs in #555, which is exactly "make the remaining module builds work on modern JDKs", so it has moved there along with adding Worth noting separately: |
Split out of #433, where it was unrelated to the Java 25 work it was bundled with.
UpdateThread.terminate()falls back to killing the worker when it fails to join within 5 seconds:Thread.stop()has thrownUnsupportedOperationExceptionunconditionally since Java 20, so on any recent JDK this path can only make things worse: instead of the thread being stopped, the exception propagates out ofterminate(), turning a slow shutdown into a failed one.It now interrupts the worker instead, which is the supported mechanism and releases the thread if it is waiting on an interruptible operation. The javadoc and the log message are updated to match.
Found while getting the repository to build on JDK 25, but it is not a Java 25 issue — it has been broken since Java 20.
🤖 Generated with Claude Code