When using Subversion 1.9.x with a Diffusion-hosted repo, some commands hang


#1

Observed Behavior:
I’m able to create a Diffusion-hosted Subversion repository, then check it out and make commits to it using Subversion client version 1.7, 1.8, or 1.9.

However, some commands, like svn diff, svn cat, and svn merge hang when using Subversion client version 1.9. (Those same commands work fine when using Subversion client version 1.7 or 1.8.)

Expected Behavior:
I expect the latest version of the Subversion client to work with Phabricator.

Phabricator Version:
Tested with the latest stable branch (563d42d).

Reproduction Steps:
I spent a few hours debugging this, and the problem seems to be due to wire-protocol differences between Subversion client versions. For example, when I run svn cat, it hangs on the get-file command. Here’s the wire-protocol stream for a few different client versions:

  • svn 1.7.14 ( get-file ( 0: ( 19 ) false true ) ) — works
  • svn 1.8.16 ( get-file ( 0: ( 19 ) false true ) ) — works
  • svn 1.9.4 ( get-file ( 0: ( 19 ) true false false ) ) — hangs
  • svn 1.9.7 ( get-file ( 0: ( 19 ) true false false ) ) — hangs

That is, in 1.9.x, there’s an optional third boolean argument, and there are two spaces between the 2nd and 3rd boolean argument (there really are 2 spaces, but this Discourse forum seems to merge multiple consecutive spaces).

The two spaces are the problem — in DiffusionSubversionWireProtocol::writeData(), Phabricator can’t match the double-space, so it ignores the command, and the client is left in the lurch.

If I modify the first regex so that it matches multiple spaces between words (\s+ instead of \s), it enables Subversion client 1.9.x to work. Here’s a patch: https://gist.github.com/smokris/a22dab24da11859285785e43313ee845


#2

This problem also happens with svn 1.10.0.

It appears to have been fixed by https://secure.phabricator.com/T13140 (included with the 2018.20 release).