Skip to content

Conversation

ttaylorr
Copy link
Contributor

This pull-request fixes an issue described in #1580, where, when using the transferqueue with lfs.batch=false, a failed legacy check would result in a nil-pointer dereference panic.

To ensure further safety, I added two new oidHandlers to force a finite number of retries into both the upload/download check for legacy transfers. I will follow this up in my next pull-request with a similar solution for the storage endpoint so we can also test this behavior when using the batch API.

/cc @technoweenie @rubyist @sschuberth #1580

@@ -338,7 +338,7 @@ func (q *TransferQueue) individualApiRoutine(apiWaiter chan interface{}) {
for t := range q.apic {
obj, err := t.LegacyCheck()
if err != nil {
if q.canRetryObject(obj.Oid, err) {
if q.canRetryObject(t.Oid(), err) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the actual bug.

Copy link
Member

Choose a reason for hiding this comment

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

Confirmed that this fixes the issue, and that the new test-legacy-retries would catch it if it still was present. Thanks!

@@ -70,7 +70,8 @@ refute_server_object() {
curl -v "$GITSERVER/$reponame.git/info/lfs/objects/$oid" \
-u "user:pass" \
-o http.json \
-H "Accept: application/vnd.git-lfs+json" 2>&1 |
-H "Accept: application/vnd.git-lfs+json" \
-H "X-Ignore-Retries: true" 2>&1 |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

X-Ignore-Retries is added as a header value here so as to not fail these assert_server_object when the objects that are being looked for have a failure count assosciated with them.

Versions of Git in the 1.8.x series do not support empty config values during
clone, so provide a no-op smudge filter during clone.
@ttaylorr ttaylorr force-pushed the legacy-retries-test branch from 904a812 to 0779577 Compare October 15, 2016 00:22
@ttaylorr ttaylorr merged commit 018ae22 into master Oct 15, 2016
@ttaylorr ttaylorr deleted the legacy-retries-test branch October 15, 2016 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants