diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/patch/IntraLineLoader.java b/gerrit-server/src/main/java/com/google/gerrit/server/patch/IntraLineLoader.java index 0ac1af2a18..358d3baa6e 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/patch/IntraLineLoader.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/patch/IntraLineLoader.java @@ -133,16 +133,21 @@ class IntraLineLoader extends EntryCreator { + " comparing " + key.getBlobA().name() // + ".." + key.getBlobB().name() // + ". Killing " + thread.getName()); - try { - thread.stop(); - } catch (Throwable error) { - // Ignore any reason the thread won't stop. - log.error("Cannot stop runaway thread " + thread.getName(), error); - } + forcefullyKillThreadInAnUglyWay(); return Result.TIMEOUT; } } + @SuppressWarnings("deprecation") + private void forcefullyKillThreadInAnUglyWay() { + try { + thread.stop(); + } catch (Throwable error) { + // Ignore any reason the thread won't stop. + log.error("Cannot stop runaway thread " + thread.getName(), error); + } + } + void end() { if (!input.offer(Input.END_THREAD)) { log.error("Cannot gracefully stop thread " + thread.getName());