Page MenuHomeSoftware Heritage

git.loader: fix failing origin visit update step due to uninitialized internal state variables
ClosedPublic

Authored by ardumont on Apr 15 2020, 10:17 AM.

Details

Summary

Currently, a failure happens for some reason. As some internal state variables
are not initialized (they are in fetch_data but not in __init__), this
makes the get_snapshot method fails because of it. Then that's making the
visit update step fails.

Adding the proper initialization for those variables in the __init__ method
should fix it. That will allow the failed state of the visit to be updated
properly in the storage. Associating an empty snapshot to the failed visit.

This should fix issues like [1]

[1] https://sentry.softwareheritage.org/share/issue/ace9143c0f6244b49b18cca49a5aa809/

Test Plan

tox

Diff Detail

Repository
rDLDG Git loader
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ardumont created this revision.Apr 15 2020, 10:17 AM

Build is green

Patch application report for D3019 (id=10729)

Rebasing onto f4fcae5401...

Current branch diff-target is up to date.
Changes applied before test
commit d6a59370a142d8bbfdc06256e38f13e268a9c156
Author: Antoine R. Dumont (@ardumont) <antoine.romain.dumont@gmail.com>
Date:   Wed Apr 15 10:15:59 2020 +0200

    git.loader: Initialize internal state in __init__
    
    This should fix issues like [1]
    
    https://sentry.softwareheritage.org/share/issue/ace9143c0f6244b49b18cca49a5aa809/

See https://jenkins.softwareheritage.org/job/DLDG/job/tests-on-diff/4/ for more details.

ardumont edited the summary of this revision. (Show Details)Apr 15 2020, 10:20 AM
ardumont edited the summary of this revision. (Show Details)Apr 15 2020, 10:24 AM
ardumont added a project: Git loader.
ardumont retitled this revision from git.loader: Initialize internal state in __init__ to git.loader: fix failing origin visit update step due to uninitialized internal state variables.
ardumont updated this revision to Diff 10730.Apr 15 2020, 10:25 AM
ardumont edited the summary of this revision. (Show Details)

Improve the git commit

ardumont edited the summary of this revision. (Show Details)Apr 15 2020, 10:26 AM

Build is green

Patch application report for D3019 (id=10730)

Rebasing onto f4fcae5401...

Current branch diff-target is up to date.
Changes applied before test
commit 81ee46caa91f6c10252e1d7a704af7db05699321
Author: Antoine R. Dumont (@ardumont) <antoine.romain.dumont@gmail.com>
Date:   Wed Apr 15 10:15:59 2020 +0200

    git.loader: fix failing origin visit update step
    
    due to uninitialized state variables
    
    Currently, a failure happens for some reason. As some internal state variables
    are not initialized (they are in fetch_data but not in __init__), this
    makes the get_snapshot method fails because of it. Then that's making the
    visit update step fails.
    
    Adding the proper initialization for those variables in the __init__ method
    should fix it. That will allow the failed state of the visit to be updated
    properly in the storage. Associating an empty snapshot to the failed visit.
    
    This should fix issues like [1]
    
    https://sentry.softwareheritage.org/share/issue/ace9143c0f6244b49b18cca49a5aa809/

See https://jenkins.softwareheritage.org/job/DLDG/job/tests-on-diff/5/ for more details.

anlambert accepted this revision.Apr 15 2020, 11:42 AM
anlambert added a subscriber: anlambert.

I got the exact same situation when I updated the mercurial loader to swh-model objects.

This revision is now accepted and ready to land.Apr 15 2020, 11:42 AM
This revision was automatically updated to reflect the committed changes.