Skip to contentSkip to conversation

Move JGit off JSch?

DISCUSSION Shawn O. Pearce 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

I'm fed up with JSch.

The remote.<name>.timeout stuff I added recently to JGit causes JSch to throw NPE on timeout[1] and the original author seems to think that's a reasonable thing to do[2].

MINA SSHD[3] contains a different client implementation, licensed under the Apache License 2.0. Its currently missing public key support[4] but the library is actually a pretty solid library, and the author seems to have a decent clue.

I'm really starting to consider adding the public key support the client side of MINA SSHD, and then rewriting TransportGitSsh to use it instead of JSch. The downside is, that really increases our dependency chain, and SSH key management under Eclipse becomes a unique EGit problem as we can't piggy-back onto the existing JSch key management already done by the workbench.

But, I just spent the last ~3 hours digging around JSch trying to fix this NPE bug... and realized the code is very thread unsafe, uses at least 2 threads per connection (your thread, and a thread it spawns for you) so you have no choice but to use threads, and the author seems to think random NPEs are OK (see [2] and all of the NPE bugs on sourceforge).

[1] http://jira.source.android.com/jira/browse/GERRIT-233
[2] http://www.mail-archive.com/[email protected]/msg00520.html
[3] http://mina.apache.org/sshd/
[4] https://issues.apache.org/jira/browse/SSHD-25

Signature · 1 line
Shawn.
#1 lore raw

torsdag 25 juni 2009 20:14:28 skrev "Shawn O. Pearce" <[email protected]>:

Quoted 10 lines

I'm fed up with JSch.

The remote.<name>.timeout stuff I added recently to JGit causes JSch to throw NPE on timeout[1] and the original author seems to think that's a reasonable thing to do[2].

MINA SSHD[3] contains a different client implementation, licensed under the Apache License 2.0. Its currently missing public key support[4] but the library is actually a pretty solid library, and the author seems to have a decent clue.

Clues are useful :)

Quoted 6 lines

I'm really starting to consider adding the public key support the client side of MINA SSHD, and then rewriting TransportGitSsh to use it instead of JSch. The downside is, that really increases our dependency chain, and SSH key management under Eclipse becomes a unique EGit problem as we can't piggy-back onto the existing JSch key management already done by the workbench.

I haven't really looked into JSch internals, but rewriting complex code without trying hard to fix the problem might not be worth it. New code /will/ have problems and having a different mechanism for key management is in some very obscure corner on the reverse side of my wish list.

Quoted 1 line

But, I just spent the last ~3 hours digging around JSch trying to

I'm not quite as efficient as you, but I've spent more than three hours on fixing much simpler things.

Quoted 5 lines

fix this NPE bug... and realized the code is very thread unsafe, uses at least 2 threads per connection (your thread, and a thread it spawns for you) so you have no choice but to use threads, and the author seems to think random NPEs are OK (see [2] and all of the NPE bugs on sourceforge).

Can't we bug him a little more, but then again patches are probably more convincing than bug reports. Perhaps you could explain the issues in more detail before we start rewriting the key management into SSHD.

Should we raise a bug report in eclipse about replacing JSch, in order to get some feedback from Eclipse people?

-- robin

#2 lore raw
In reply to Shawn O. Pearce
Quoted 1 line · Shawn O. Pearce

I'm fed up with JSch.

Good to know!

Last year I moved our application away from j2ssh to jsch because j2ssh was pratically dead and rather oddly implemented within our application. I chose jsch because Eclipse was using it and development was actually being done on it. I wasn't aware of the issues with it though and also was not aware of MINA.
I'll start looking into MINA soon because we're having some rather odd issue in our application that seem to point to problems with jsch under heavy load/many parallel connections. Your story lit up a light in my head to that effect :-)

Are the Eclipse folks aware of these issues? they seem rather serious. Wouldn't it be more effective to try to improve jsch through the eclipse foundation/community, from multiple sides? (excuse me for asking the obvious)

My background is in massive parallel systems so I know about the pain of implementing this kind of thing correctly (and also the reward of seeing it working...)