Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid network timeout on large histories #7

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

brlcad
Copy link

@brlcad brlcad commented Aug 23, 2013

This change should avoid a reverse svn log failure connection timeout by pulling the log in order (and extracting the last entry). This is only done if the reverse log fails in order to keep overhead low for most enlistments, but this should fix failures for a number of repositories that have a large revision history.

Christopher Sean Morrison and others added 3 commits August 23, 2013 16:14
…on. this streams the log back in that case (which keeps the network pipe open) and grabs the last revision.
…on. this streams the log back in that case (which keeps the network pipe open) and grabs the last one.
add support for when extracting HEAD:1 times out the network connection....
# intensive method that should always succeed:
# receive the revisions in order and extract
# the last entry.
run(back_to_front) || Scm::Parsers::SvnXmlParser.parse(run(front_to_back)).last

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see that run(back_to_front) will return a truthy value. Please refer to Scm::Adapters::AbstractAdapter. This calls Shellout#run, which calls Shellout.execute, which returns an array of [status, outbuf.string, errbuf.string]

It would be very helpful to have test coverage of this next_revision_xml method with the different pathways covered.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The perils of writing code one cannot easily test. Fully concur that there's a problem as written. Looks like I misread a similar snippet in lib/scm/adapters/git/head.rb that let me to think a return code would result.

What about pushing the conditional into the command begin run, then making the callee always just check parse().last?
run("#{back_to_front} || #{front_to_back}")

I can redo a push with that change if the explanation is unclear.

…t wrong. push the conditional down into sh land and let the xml parser just always pull the last one (which will be the first one with --limit 1)
@amujumdar
Copy link

@brlcad @peterdp since this repository is on SourceForge, I am going to try SvnSync'ing it. That might fix the issue altogether. Currently, we seem to be treating it as an SVN repository, one that cannot be SvnSync'ed and trying to convert it into a Git repository locally.

@josie559
Copy link

G

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants