Don't allow duplicate tasks to be queued.
Submitted by kin..@..er.com
Assigned to pan..@..e.bugs
Link to original bug (#132612)
Description
DESCRIPTION When adding the download of a complete multipart binary attachment, the task manager does BOTH of
- adding ONE TASK FOR EACH PART of the attachement, and
- automagically downloading the WHOLE attachement when running the task for the first part. Thus leading to the attachement being uselessly downloaded twice.
REPRODUCING THE BUG 1- Select some complete multipart attachement from a alt.binaries.* group. The bug is easier to observe if the number of parts is high enough, and if the parts are strictly ordered, but it is not necessary. 2- Open the task manager, and some file browser (konqueror, velocity...) showing the destination directory. Keep both windows visible on screen simultaneously at all time. 3- Ask Pan to download this attachment in some directory. 4- Once the task of the first part is reached, any available connection for the server is used for it, and it will advance very slowly, because Pan is in fact downloading the whole file. 5- A few second after the task for the first part reaches 100%, the file is saved to the disk (visible in the file browser), BUT ANY REMAINING INDIVIDUAL TASK FOR THIS ATTACHEMENT IS THEN RUN, eventually downloading all these parts once again.
RESULTS Any multipart attachment is downloaded twice, a BIG waste of bandwidth and other resources. Of all the tasks created, only the one concerning the first part is automatically removed from the task manager. All others remain in the "100% downloaded but Stopped" state. I fear, but I'm not sure, that all parts downloaded BEFORE reaching the task for the first part are not reused when running this task, and are downloaded again. As all tasks except the one of the first part are not deleted, one must do it manually after checking that the file has indded been downloaded without default. It's a real pain.
WHAT WOULD I HAVE EXPECTED I would have liked to see either of these two solutions, the latter being the best according to me:
-1- Only one task is created for the whole attachement, just as one can have complete pultipart attachment appear in the headers pane as a single entry.
-2- Having one task by file part, Pan "caching" each part until all of them are downloaded. Once all parts downloade, it would then decode and save the complete file, and remove ALL relevant tasks from the task manager.
BUILD Pan is ver. 0.14.2, from the debian "unstable" binary package. Gnome is v2.4 according to the version of the gnome libraries-related packages provided by Debian. The GUI I effectively run is KDE, though. Linux Kernel is a custom 2.4.25-pre4
ADDITIONAL INFO I still have a few hundred tasks queued in my task manager, so I'm unable to provide "unpolluted" run logs for this bug for now. If you think it is necessary, I'll make one tomorrow evening (GMT). My queue should by empty by then. I consider that totally wasting half of the bandwidth provided by the news server and one's Internet connection is a MAJOR issue, but feel free to modify the severity of the bug if you disagree with this.
Version: pre-1.0 betas