FileStore checksumming will always fail on resumed download

Bug #1237990 reported by Scott Moser
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
simplestreams
Fix Released
Undecided
Unassigned
simplestreams (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

The resuming code in the Filestore seems like it will always fail.
Thats because we don't ever read the contents of the existing and run it through the checksum update.

we just update what we've read from the other end, and if that was only part of the file, then clearly the checksum wont match.

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: simplestreams 0.1.0~bzr313-0ubuntu1
ProcVersionSignature: Ubuntu 3.11.0-9.16-generic 3.11.2
Uname: Linux 3.11.0-9-generic x86_64
ApportVersion: 2.12.5-0ubuntu1
Architecture: amd64
Date: Thu Oct 10 08:39:38 2013
EcryptfsInUse: Yes
InstallationDate: Installed on 2011-10-19 (721 days ago)
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
MarkForUpload: True
PackageArchitecture: all
ProcEnviron:
 TERM=screen-bce
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: simplestreams
UpgradeStatus: Upgraded to saucy on 2013-05-20 (143 days ago)

Revision history for this message
Scott Moser (smoser) wrote :
Changed in simplestreams (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Scott Moser (smoser) wrote :

The fix I committed included a test case, but here is a similar one that uses the sstream-mirror:

#!/bin/sh -e
dlfile="examples/foocloud/streams/v1/com.example.foovendor:released:download.json"
rm -Rf out.d
./tools/tenv ./bin/sstream-mirror --max=1 "$dlfile" out.d

# now truncate some of the files and rename to .part
files=$(find out.d -type f -name "*.tar.gz")
for f in $files; do truncate --size 10 "$f" && mv "$f" "$f.part"; done

# remove the state, so the mirror doesn't think its already done.

rm -Rf out.d/.data out.d/streams
./tools/tenv ./bin/sstream-mirror -vv --max=1 "$dlfile" out.d

# the parts need to hvae been deleted now
parts=""
for f in $files; do
  if [ -e "$f.part" ]; then
    echo "FAILED: $f.part existed";
    parts="${parts} $f.part"
  fi
done

[ -z "$parts" ] || exit 1

Changed in simplestreams:
status: New → Fix Committed
Revision history for this message
Scott Moser (smoser) wrote :

committed in trunk at 316.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package simplestreams - 0.1.0~bzr316-0ubuntu1

---------------
simplestreams (0.1.0~bzr316-0ubuntu1) saucy; urgency=low

  * New upstream snapshot.
    * fix bug in resuming a partial download in sstream-mirror
      or anything using the FileObjectStore (LP: #1237990)
 -- Scott Moser <email address hidden> Thu, 10 Oct 2013 12:07:34 -0400

Changed in simplestreams (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Scott Moser (smoser) wrote : Fixed in simplestreams version 0.1.0.

This bug is believed to be fixed in simplestreams in version 0.1.0. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in simplestreams:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.