Skip to content

Conversation

@blushingpenguin
Copy link
Contributor

To fix the task queue re-ordering, this basically reverts the chunk of #1054 that added a second thread safe tasks queue and goes back to using the Gtk.ListStore to contain the tasks work queue. To workaround the problem of the background download threads triggering exceptions when concurrently accessing the list store while the main ui thread is manipulating it, only the main ui thread accesses the list store, and background worker threads queue a request for a task to the main thread by adding an idle function which dequeues a task, then sends the result back to the background thread (via the DequeRequest class).

This also fixes the corner case of downloading a task that no longer exists. That can be triggered by downloading some episodes, then in the tasks list cancelling one of the downloads. Once cancellation has finished, cancel all other downloads, then quickly right click on the cancelled task to get the context menu. Wait until the other tasks have been cancelled and the tasks list has been cleared, then choose to download the cancelled task -- at this point the task is in the queued state, not in the list (and hence not in the queue) but attached to the episode,so it becomes impossible to download the episode that the task is attached to. This is fixed by detecting the case of the task not being in the tasks list and adding it back in if necessary.

@auouymous
Copy link
Member

Is the second issue #1149 (comment)?

@blushingpenguin
Copy link
Contributor Author

@auouymous Yes, that is the second issue

@auouymous
Copy link
Member

I'm unable to cancel failed downloads (the 'ccc' episodes at http://borg.qzx.com/test-rss.php always fail).

@blushingpenguin
Copy link
Contributor Author

blushingpenguin commented Sep 13, 2021

I'm unable to cancel failed downloads (the 'ccc' episodes at http://borg.qzx.com/test-rss.php always fail).

I have fixed this one

@blushingpenguin
Copy link
Contributor Author

Thanks for looking at this

@auouymous auouymous merged commit ed5d18e into gpodder:master Sep 14, 2021
@auouymous
Copy link
Member

Thanks for fixing these issues.

@elelay
Copy link
Member

elelay commented Sep 14, 2021

Thank you both for your hard work making things work again after the switch to gio!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants