mirror of
https://github.com/google/nomulus.git
synced 2025-05-29 08:50:09 +02: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:
parent
b6d2790a13
commit
e3531e9f29
1 changed files with 0 additions and 12 deletions
|
@ -16,7 +16,6 @@ package google.registry.rde;
|
||||||
|
|
||||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||||
|
|
||||||
import com.google.appengine.api.ThreadManager;
|
|
||||||
import com.jcraft.jsch.JSch;
|
import com.jcraft.jsch.JSch;
|
||||||
import com.jcraft.jsch.JSchException;
|
import com.jcraft.jsch.JSchException;
|
||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
|
@ -33,7 +32,6 @@ public final class JSchModule {
|
||||||
@Config("rdeSshIdentity") String identity,
|
@Config("rdeSshIdentity") String identity,
|
||||||
@Key("rdeSshClientPrivateKey") String privateKey,
|
@Key("rdeSshClientPrivateKey") String privateKey,
|
||||||
@Key("rdeSshClientPublicKey") String publicKey) {
|
@Key("rdeSshClientPublicKey") String publicKey) {
|
||||||
applyAppEngineKludge();
|
|
||||||
JSch jsch = new JSch();
|
JSch jsch = new JSch();
|
||||||
try {
|
try {
|
||||||
jsch.addIdentity(
|
jsch.addIdentity(
|
||||||
|
@ -48,14 +46,4 @@ public final class JSchModule {
|
||||||
JSch.setConfig("StrictHostKeyChecking", "no");
|
JSch.setConfig("StrictHostKeyChecking", "no");
|
||||||
return jsch;
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue