#7195 BLOC Never A: Corrupted multiple downloads at the same time
Zarro Boogs per Child
bugtracker at laptop.org
Thu Jun 5 03:15:00 EDT 2008
#7195: Corrupted multiple downloads at the same time
------------------------+---------------------------------------------------
Reporter: cjb | Owner: erikos
Type: defect | Status: new
Priority: blocker | Milestone: Never Assigned
Component: datastore | Version: Update.1
Resolution: | Keywords:
Verified: 0 | Blocking:
Blockedby: |
------------------------+---------------------------------------------------
Comment(by tomeu):
Replying to [comment:1 mstone]:
> After reviewing the Browse source code, I think I see two problems in
downloadmanager.py:
>
> 1. According to the log, we're creating two DownloadManagers. Why on
earth are we creating two DownloadManagers?
DownloadManager should have been renamed to HelperAppLauncherDialog or
something similar. We are not implementing our own nsIDownloadManager
anymore.
http://www.xulplanet.com/references/xpcomref/ifaces/nsIHelperAppLauncherDialog.html
http://www.xulplanet.com/references/xpcomref/ifaces/nsIDownloadManager.html
Mozilla thinks that the user wants to download the same file twice, so
asks us twice where each file should be saved to. And we seem to tell it
to save to the same location.
> 2. Empirically, we're seeing interleaved writes. However, all data
transfer is done by xulrunner; we just supply it a target path.
Consequently, I infer that we're creating two Downloads (Transfers) to the
same path. We should never ever have two transfers to the same target path
if that target path is a local file.
Right.
> Next question: did I miss something? Is there some reason why the two
DownloadManagers we create are going to return distinct file paths?
Nope.
> Final question: what should we do? My preference at the moment is to use
a synchronization mechanism (e.g. a lock) to deduplicate Transfer target
paths. Comments?
Any problem with just using mkstemp?
--
Ticket URL: <http://dev.laptop.org/ticket/7195#comment:3>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system
More information about the Bugs
mailing list