Wrong queue size logged?

Bug #1145088 reported by Michael Schwendt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SoundConverter
Fix Released
Low
GautierPortet

Bug Description

This is for an old report that Soundconverter prints a wrong queue size, because it doesn't take into account the number of running tasks. Occasionally a user stumbles into this, because "queue size = number of files" is the expected output.

diff -Nur soundconverter-2.0.4-orig/soundconverter/queue.py soundconverter-2.0.4-fedora/soundconverter/queue.py
--- soundconverter-2.0.4-orig/soundconverter/queue.py 2012-01-04 00:23:34.000000000 +0100
+++ soundconverter-2.0.4-fedora/soundconverter/queue.py 2013-02-26 13:06:45.066007125 +0100
@@ -79,7 +79,8 @@

     def started(self):
         """ BackgroundTask setup callback """
- log('Queue start: %d tasks, %d thread(s).' % (len(self.waiting_tasks), settings['jobs']))
+ tn = len(self.waiting_tasks) + len(self.running_tasks)
+ log('Queue start: %d tasks, %d thread(s).' % (tn, settings['jobs']))
         self.count = 0
         self.finished_tasks = 0
         self.start_time = time.time()

Revision history for this message
GautierPortet (kassoulet) wrote :

This sounds wrong. Not the fix, but the fact that an already running queue can be started again...

Revision history for this message
Michael Schwendt (mschwendt) wrote :

The reason for the wrong output is that add_task() starts the queue and moves the first tasks onto the running_task list. The 'started' callback, which prints the queue size, happens later.

Revision history for this message
GautierPortet (kassoulet) wrote :
Changed in soundconverter:
status: New → Fix Committed
importance: Undecided → Low
assignee: nobody → GautierPortet (kassoulet)
milestone: none → 2.0.5
Changed in soundconverter:
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.