Skip to content

Address consecutive EXPORT#71

Open
Lykos153 wants to merge 3 commits intomasterfrom
fix/consecutive-exports
Open

Address consecutive EXPORT#71
Lykos153 wants to merge 3 commits intomasterfrom
fix/consecutive-exports

Conversation

@Lykos153
Copy link
Owner

@Lykos153 Lykos153 commented Apr 14, 2023

git-annex has a bug[1] that affects special remotes that support exporttree: Sometimes the EXPORT command is sent to a different process of the external remote than the following TRANSFEREXPORT command and as a result, one process receives two EXPORTs in a row.

This PR adds a check of consecutive EXPORTs so that the remote replies with an ERROR in this case.

Versions of git-annex that contain a fix now accept VERSION 2 from external special remotes.
Starting with this commit, AnnexRemote will send VERSION 2 if exporttree
is supported by the remote and VERSION 1 if not.

[1] http://git-annex.branchable.com/bugs/external_remote_export_sent_to_wrong_process

@Lykos153 Lykos153 force-pushed the fix/consecutive-exports branch 2 times, most recently from bdc0a6c to 4ca6e8c Compare April 14, 2023 20:20
@Lykos153 Lykos153 changed the title fix: fail on consecutive EXPORT Address consecutive EXPORT Apr 14, 2023
@Lykos153 Lykos153 force-pushed the fix/consecutive-exports branch from 4ca6e8c to d822f2a Compare April 14, 2023 23:04
@yarikoptic
Copy link
Collaborator

sorry -- we amassed conflicts since then. BTW -- were you done with this PR?

git-annex has a bug[1] that affects special remotes that support exporttree:
Sometimes the EXPORT command is sent to a different process of the external
remote than the following TRANSFEREXPORT command and as a result, one process
receives two EXPORTs in a row.

This commit adds a check of consecutive EXPORTs so that the remote replies with
an ERROR in this case.

[1] http://git-annex.branchable.com/bugs/external_remote_export_sent_to_wrong_process
Versions of git-annex that contain a fix for the consecutive EXPORT race
condition[1] now accept VERSION 2 from external special remotes.
Starting with this commit, AnnexRemote will send VERSION 2 if exporttree
is supported by the remote and VERSION 1 if not.

[1] https://git-annex.branchable.com/bugs/external_remote_export_sent_to_wrong_process/
@yarikoptic yarikoptic force-pushed the fix/consecutive-exports branch from d822f2a to 3399dc0 Compare October 27, 2023 18:11
@yarikoptic
Copy link
Collaborator

FWIW, while still on this repo -- I have rebased this PR and resolved conflicts

@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (b23c5d9) 96.10% compared to head (8ccfd27) 96.19%.
Report is 10 commits behind head on master.

Files Patch % Lines
annexremote/annexremote.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #71      +/-   ##
==========================================
+ Coverage   96.10%   96.19%   +0.08%     
==========================================
  Files           2        2              
  Lines         385      394       +9     
==========================================
+ Hits          370      379       +9     
  Misses         15       15              
Flag Coverage Δ
unittests 96.19% <90.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Lykos153
Copy link
Owner Author

Sorry, totally overlooked your comments last year. Yes, I was done with it and thought I leave merging with you guys as by now you're more familiar with the repo than me.

@property
def version(self):
if self.remote.exportsupported() and not self.remote.force_version1:
return "VERSION 2"
Copy link
Collaborator

Choose a reason for hiding this comment

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

wouldn't sending VERSION 2 depend on git-annex version? since if it is annex older than the one added support for VERSION 2, it would puke (or not)?

Copy link
Owner Author

@Lykos153 Lykos153 Dec 12, 2024

Choose a reason for hiding this comment

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

That's true. Now that I'm looking into it again I think we should just scrap the last two commits. VERSION 2 basically only exists so a special remote can ensure that git-annex is new enough to not have the bug. But 78c280d already handles the bug,

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.

2 participants