Skip to content

On checkout git-lfs process execute git-lfs-authenticate for each downloading file #2018

Closed

Description

@bozaro

I use Git v2.12.0 and Git LFS v2.0.0.
In this configuration filter-process used for git-lfs intergration (single git-lfs for one git command).

In this case git-lfs can store git-lfs-authenticate result in process state before it expired. But git-lfs run git-lfs-authenticate for every downloading file. On Windows this command taked too long time even on local environment (~0.8 sec in my case).

git-lfs.trace.txt

Activity

  1. technoweenie commented on Mar 9, 2017

    @technoweenie
    Contributor

    It looks like it's happening on each batch, not each file. For some reason, your batch size is 1 though. Are you scanning multiple refs with just 1 object? By default, LFS has a batch size of 100 objects. But it will send the remainder when the transfer queue is shut down. The transfer queue should emit a trace message like "tq: running as batched queue, batch size of 100", which should tell you its batch size.

    Here's an example trace from git lfs fetch --all on a small repository:

    trace git-lfs: tq: running as batched queue, batch size of 100
    trace git-lfs: fetch bin/b.bin [0263829989b6fd954f72baaf2fc64bc2e2f01d692d4de72986ea808f6e99813f]
    trace git-lfs: fetch bin/hi.bin [98ea6e4f216f2fb4b69fff9b3a44842c38686ca685f3f55dc48c5d3fb1107be4]
    trace git-lfs: fetch gif/atom-undo.gif [0350ec3d1c0bd3e909010ed6056fc897ffbb199d22087bd53b0dac96f9be1fc3]
    trace git-lfs: fetch gif/droidtocat.gif [d1c8fab51418ef587fcf5dd8e73c60b9700704e2f8f5292ea12ec27c285b23a3]
    trace git-lfs: fetch jpg/kabuki-tattoo-left.JPG [e1732d149d262963996ca77a47a5d3c51c85c6e97187afad370a8bef2828b6b7]
    trace git-lfs: fetch png/render.png [55d51edb307ed7bf4a1bbca3867d132a07f76828d57f37e0f31f712c02ceafe0]
    trace git-lfs: fetch bar.txt [7d865e959b2466918c9863afca942d0fb89d7c9ac0c99bafc3749504ded97730]
    trace git-lfs: fetch gif/atom-undo.gif [b9f86fab477109565871ced361ba69f2425a91fbe6057fa7a9629a8d536d7c71]
    trace git-lfs: fetch dark.png [02180b45e1cf13218e00cc8ebe268618b68cca0616bce7c50225b5be5a70d3f7]
    trace git-lfs: fetch render.png [124733b36d098353ad16bb11646643709e87c4746e0d97913a9826829e0477a3]
    trace git-lfs: tq: sending batch of size 10
    trace git-lfs: ssh: [email protected] git-lfs-authenticate github/git-lfs-test.git download
    trace git-lfs: api: batch 10 files
    
  2. bozaro commented on Mar 9, 2017

    @bozaro
    ContributorAuthor

    As I understand, filter-process process files one-by-one. So git checkout/git reset --hard and other commands always use batch with 1 object.

  3. technoweenie commented on Mar 9, 2017

    @technoweenie
    Contributor

    Ah yeah, we're waiting on some updates to the filter process stuff in git so it'll let us queue up multiple downloads. Here's an old POC: #1646.

  4. bozaro commented on Mar 10, 2017

    @bozaro
    ContributorAuthor

    I think this is unrelated issues.
    Ideally, client need to request authorization after 401-response from the server.

  5. ttaylorr commented on Mar 10, 2017

    @ttaylorr
    Contributor

    @bozaro on these fetch, pull, or clone operations where new objects are being downloaded in a batch size of one, you can use the Git LFS wrapped variants of those commands to work around having to re-authorize each time.

  6. bozaro commented on Mar 13, 2017

    @bozaro
    ContributorAuthor

    @ttaylorr
    Using special command for any git operation is bad idea (also I don't see git lfs reset).
    Git LFS killer feature: it don't require additional commands and can be used with any git tool out of box.

    In this case, the problem is caused by an unsuccessful batch upload implementation.
    There are no technical prerequisites or API requirements, due to which you need to call git-lfs-authenticate on each batch.

  7. bozaro commented on Mar 17, 2017

    @bozaro
    ContributorAuthor

    I try to fix this issue and create PR #2045

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions