In reference to T1633
Similar to db call skipped_content_missing, the
function checks for content in memory storage
of skipped content
Differential D1693
Get skipped content that are missing data twitu on Jul 6 2019, 9:25 AM. Authored by
Details In reference to T1633 Similar to db call skipped_content_missing, the
Diff Detail
Event TimelineComment Actions Build is green Comment Actions This logic is similar to one being used in db.skipped_content_missing. However the current implementation in_memory._content_add does not populate _skipped_contents and _skipped_content_indexes. I think there are two ways to do it:
Comment Actions It should be implemented to behave like in the postgresql storage (storage.py and db.py), so you should change _content_add, and use the same algorithm. Comment Actions I have a concern here, storage.py line 120. The function self.content_missing can throw an exception in case of a hash collision. Shouldn't line 120 be in a try except block to catch that error and ignore that particular content? Secondly, I don't fully understand what it means for content to be hidden or absent when can this happen? Comment Actions In db.py line 128, the query does not compare blake2s256 despite content_hash_keys = ['sha1', 'sha1_git', 'sha256', 'blake2s256']. Does this mean that skipped content will never be hashed with blake2s256? Comment Actions I did not find any mechanism in db.py that is actually storing skipped_content. db.py line 51, is passed without implementation. For in memory content_add, I am adding skipped_content, similar to how regular content is being added. Comment Actions Build has FAILED Link to build: https://jenkins.softwareheritage.org/job/DSTO/job/tox/556/ Comment Actions Build has FAILED Link to build: https://jenkins.softwareheritage.org/job/DSTO/job/tox/557/ Comment Actions Build is green Comment Actions Build is green Comment Actions Thanks! As I mentioned on IRC, you should un-skip test_skipped_content_add in swh/storage/tests/test_in_memory.py, otherwise all this new code does not get tested at all. Comment Actions Build is green Comment Actions Build is green Comment Actions Build is green
Comment Actions Build is green
Comment Actions One last thing: could you squash your commits, and improve the commit message (eg. "add support for skipped content in the in-memory storage") Comment Actions Build is green Comment Actions Build is green |