Project

General

Profile

[fixed] SVN-properties (r1627) not showing when browsing

Added by Mischa The Evil about 16 years ago

Hi there folks,

Intro

While being quite busy managing some old tasks I came around an issue in Redmine. Though after some investigation I found out that it might be not directly a defect in Redmine. I'm just looking for some feedback before opening a new issue...

My environment

At first my environment:
  • RHEL4/CentOS4 based Linux
  • Subversion 1.5.2
  • Ruby Enterprise Edition 1.8.6-20080810
  • Rails 2.1.2
  • Phusion Passenger 2.0.3 running on Apache 2.0.52 (patched by OS-vendor)
  • MySQL 4.1.20 (patched by OS-vendor)
  • Redmine dev-r1745 (manually patched for Rails >= 2.1.1 compatibility)

Feature in which the issue pops-up

Based on issue #1581 r1627 introduces the display of svn properties in the browser when using svn >= 1.5.0. This implementation is fixed once in r1652 after issue #1607.

An example of the result of this implementation can be seen in this screenshot:

The issue in short

Now, the problem is that most of the time (9 out of 10 times) these properties aren't showed when I'm browing my repo's. I say most of the time since sometimes (very rarely) they do show up...
This bahaviour made me curious about the src of the issue...

An exploration of the issue

After some investigation I noticed that commenting-out the following line in the file source:trunk/lib/redmine/scm/adapters/subversion_adapter.rb@1745#L112 solves the problem (the properties are showed 10 out of 10 times). This made me think about why the following methods:

        SVN_BIN = "svn" 

        class << self
          def client_version
            @@client_version ||= (svn_binary_version || [])
          end

          def svn_binary_version
            cmd = "#{SVN_BIN} --version" 
            version = nil
            shellout(cmd) do |io|
              # Read svn version in first returned line
              if m = io.gets.match(%r{((\d+\.)+\d+)})
                version = m[0].scan(%r{\d+}).collect(&:to_i)
              end
            end
            return nil if $? && $?.exitstatus != 0
            version
          end
        end

90% of the times returns nil and sometimes returns the correct version...

Cause of the issue

I went down watching my logs closely and indeed found the cause of the issue; 9/10 times the version-check is ended prematurely due to the following svn-error:

svn: Write error: Broken pipe

This results in the situation where 9 out of 10 time version.nil? == TRUE, which itself explains why the properties aren't displayed in the browse-view.

Workaround for the issue

This can be quite simple. In my situation it is sufficient to comment-out the following line 112 in the file source:trunk/lib/redmine/scm/adapters/subversion_adapter.rb@1745#L112:

# return nil unless self.class.client_version_above?([1, 5, 0])

This change prevents Redmine from checking if the version of svn is >= 1.5.0 to display the properties, which results in the situation where the properties are always shown and the "svn: Write error: Broken pipe"-errors disappear.
It works offcourse only when you are indeed using Subversion >= 1.5.0...

Source of the issue

Now, this is maybe the most important part of this post. My precise questions here would be the following:

  1. Is the error svn: Write error: Broken pipe caused by Redmine explicitly? Maybe the way Redmine calls the svn binairy can be the problem... I don't know... :-(
  2. Can this issue be solved by changing the way how Redmine does it's version-checks?

Greetings,

Mischa.


Replies (3)

RE: SVN-properties (r1627) not showing when browsing - Added by Mischa The Evil about 16 years ago

Additionally, these "svn: Write error: Broken pipe"-errors also regularly (though in contrast to the above mentioned issue not 9 out of 10 times) causes the following scm-test to fail:

test_changes(RepositoriesSubversionControllerTest).

The complete output of the failure:

Name: test_changes(RepositoriesSubversionControllerTest)
Type: Failure
Message: <nil> expected to not be nil.

./test/functional/repositories_subversion_controller_test.rb:80:in `test_changes'
     /opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `__send__'
     /opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `run'

Since source:trunk/test/functional/repositories_subversion_controller_test.rb@1745#L80 refers to the assertion regarding the existence of the properties,

assert_not_nil assigns(:properties)
I am most certain that the test-failure will be gone permanently after I'd applied my workaround.

I'll keep this thread updated regarding these test-failures...

RE: SVN-properties (r1627) not showing when browsing - Added by Mischa The Evil about 14 years ago

Someone else (Ве Fio) has (finally) raised an issue for this error. See #6860.

RE: SVN-properties (r1627) not showing when browsing - Added by Mischa The Evil about 14 years ago

Mischa The Evil wrote:

Someone else (Ве Fio) has (finally) raised an issue for this error. See #6860.

It's fixed by Jean-Philippe Lang in source:/trunk in r4419 and merged into source:/branches/1.0-stable in r4420 to be included in Redmine 1.0.4 (and up).

    (1-3/3)