hierynomus / hierynomus/sshj

KeepAlive threads don't die if authPassword fails

Open
#506 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.7k
Forks
620
Avg merge
3d 23h
Merged PRs (30d)
11

Description

When there's an EOF during `authPassword()`, the KeepAlive thread is not stopped, and because the transport is not running, just keeps sleeping on an infinite loop.

An example of the logs I'm seeing:
```
2019-04-11 23:50:38,839 ERROR [[reader]] (()) net.schmizz.sshj.transport.TransportImpl : Dying because - Broken transport; encountered EOF
net.schmizz.sshj.transport.TransportException: Broken transport; encountered EOF
at net.schmizz.sshj.transport.Reader.run(Reader.java:59)
2019-04-11 23:50:38,839 INFO [[reader]] (()) net.schmizz.sshj.transport.TransportImpl : Disconnected - UNKNOWN
2019-04-11 23:50:38,843 ERROR [[interact-486]] (()) net.schmizz.concurrent.Promise : <> woke to: net.schmizz.sshj.userauth.UserAuthException: Broken transport; encountered EOF
```

I'm trying to work around it by switching the order of autoPassword and turning the KeepAlive on, from the order given in [the KeepAlive example](../tree/master/examples/src/main/java/net/schmizz/sshj/examples/KeepAlive.java):
```
client.connect(ip, port);
client.getConnection().getKeepAlive().setKeepAliveInterval(timeoutInSeconds);
client.authPassword(user, password);
```
to
```
client.connect(ip, port);
client.authPassword(user, password);
client.getConnection().getKeepAlive().setKeepAliveInterval(timeoutInSeconds);
```

will update when I find out the results.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.