From e3531e9f2920cb55a3bbaaab850fa7e7d6503984 Mon Sep 17 00:00:00 2001 From: mmuller Date: Wed, 17 Jan 2018 06:58:42 -0800 Subject: [PATCH] Remove JSch threading hack Remove the hack that allows us to use JSch with Java 7 on App Engine - basically, we have a modified version of JSch that lets us attach a GAE-friendly thread factory and use that for all JSch threads. TESTED: Verified that RDE SFTP uploads still work on alpha. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=182208225 --- java/google/registry/rde/JSchModule.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/java/google/registry/rde/JSchModule.java b/java/google/registry/rde/JSchModule.java index 70c9ab7b8..93a885353 100644 --- a/java/google/registry/rde/JSchModule.java +++ b/java/google/registry/rde/JSchModule.java @@ -16,7 +16,6 @@ package google.registry.rde; import static java.nio.charset.StandardCharsets.UTF_8; -import com.google.appengine.api.ThreadManager; import com.jcraft.jsch.JSch; import com.jcraft.jsch.JSchException; import dagger.Module; @@ -33,7 +32,6 @@ public final class JSchModule { @Config("rdeSshIdentity") String identity, @Key("rdeSshClientPrivateKey") String privateKey, @Key("rdeSshClientPublicKey") String publicKey) { - applyAppEngineKludge(); JSch jsch = new JSch(); try { jsch.addIdentity( @@ -48,14 +46,4 @@ public final class JSchModule { JSch.setConfig("StrictHostKeyChecking", "no"); return jsch; } - - /** - * Overrides the threadFactory used in JSch and disable {@link Thread#setName(String)} in order to - * ensure GAE compatibility. By default it uses the default executor, which fails under GAE. This - * is currently a Google-specific patch that needs to be sent upstream. - */ - private static void applyAppEngineKludge() { - JSch.threadFactory = ThreadManager.currentRequestThreadFactory(); - JSch.useThreadNames = false; - } }