Merge lp://staging/~facundo/ubuntuone-client/stable--long-partial-filenames into lp://staging/ubuntuone-client/stable-1-4

Proposed by Facundo Batista
Status: Merged
Approved by: John O'Brien
Approved revision: 737
Merged at revision: 737
Proposed branch: lp://staging/~facundo/ubuntuone-client/stable--long-partial-filenames
Merge into: lp://staging/ubuntuone-client/stable-1-4
Diff against target: 216 lines (+151/-6)
2 files modified
tests/syncdaemon/test_fsm.py (+125/-2)
ubuntuone/syncdaemon/filesystem_manager.py (+26/-4)
To merge this branch: bzr merge lp://staging/~facundo/ubuntuone-client/stable--long-partial-filenames
Reviewer Review Type Date Requested Status
John O'Brien (community) Approve
Guillermo Gonzalez Approve
Review via email: mp+39304@code.staging.launchpad.net

Commit message

Handle better errors on partial creation. (LP: #657195, LP: #662660)

Description of the change

Handle better errors on partial creation.

This has two sides:

- Leave the node in a better state if *any* error happens when touching disk: in this case, I moved the MD handling before the filesystem handling. So, from now, if something bad happens when creating the partial in the disk, the node will still be in SERVER state, and LR will re-download it.

- Support too long filenames: for this, specific code were added to the filename handling when the file is created: we trim the filename until the filesystem stops giving that error to us.

As the filename may be trimmed according to filesystem errors, it's not fully predictable any more. So, when that happens, it's stored in the metadata object.

Tests included for everything.

To post a comment you must log in.
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

nice, tests pass.

review: Approve
Revision history for this message
John O'Brien (jdobrien) wrote :

Looks good...

Should we worry about filename = filename[:-10*trim] resulting in an index out of range if it evaluates to longer than the filename? I guess it's an internal function so perhaps not.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches