DownloadFinished signal triggers when file has not yet completed writing
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Ubuntu One Client | Status tracked in Trunk | |||||
Stable-3-0 |
New
|
Undecided
|
Unassigned | |||
Stable-4-0 |
Fix Released
|
Undecided
|
Unassigned | |||
Trunk |
Fix Released
|
Undecided
|
Alejandro J. Cura | |||
ubuntuone-client (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | |||
Precise |
Won't Fix
|
Undecided
|
Unassigned | |||
Quantal |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I am experiencing a problem where I connect a callback to DownloadFinished which then loads the file that has been downloaded. Unfortunately this is failing even though I can see the file on the disk - as such it looks like the signal triggers a short time before the file has completed writing.
From what I understand the file is copied to a temp dir and then moved and it seems this signal triggers when the file hits the temp dir. Can you fix this so that it triggers when the file is successfully written to its final path? Thanks!
ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: ubuntuone-client 3.99.2-0ubuntu1
ProcVersionSign
Uname: Linux 3.5.0-6-generic i686
ApportVersion: 2.4-0ubuntu6
Architecture: i386
Date: Mon Jul 30 20:45:05 2012
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release i386 (20120423)
PackageArchitec
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: ubuntuone-client
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
- Brian Curtin (community): Approve
- Roberto Alsina (community): Approve
-
Diff: 178 lines (+61/-23)5 files modifiedtests/syncdaemon/test_fsm.py (+27/-0)
tests/syncdaemon/test_interaction_interfaces.py (+28/-20)
ubuntuone/syncdaemon/event_queue.py (+1/-0)
ubuntuone/syncdaemon/filesystem_manager.py (+3/-1)
ubuntuone/syncdaemon/interaction_interfaces.py (+2/-2)
Changed in ubuntuone-client: | |
assignee: | nobody → Alejandro J. Cura (alecu) |
status: | New → Confirmed |
Changed in ubuntuone-client: | |
status: | Confirmed → Fix Committed |
I was helping Jono look into this on IRC. It seems that AQ_DOWNLOAD_ FINISHED state within the syncdaemon is used both to emit the DownloadFinished D-Bus signal to the outside world and trigger the rename from the .u1partial file to the real file name (through commit_file).
For the DownloadFinished D-Bus signal to be useful, it really should happen after the rename has completed, otherwise it is subject to the race condition Jono encountered.