mirror of
https://github.com/google/nomulus
synced 2026-02-08 05:50:24 +00:00
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user