rmcrackan / Libation

Libation: Liberate your Library
GNU General Public License v3.0
2.68k stars 146 forks source link

Specific item causes error and endless duplicates in queue #256

Closed badbob001 closed 2 years ago

badbob001 commented 2 years ago
  1. Started 7.7.1
  2. Filtered for specific title name.
  3. Click icon to download.
  4. .net error pops up. Click continue.
  5. Same item is added to queue repeatedly

Log202205.log

rmcrackan commented 2 years ago

@badbob001

Sorry this is happening. It looks like an error getting the pdf's url. Is this a book that's still in your audible library? I can't reproduce the error so I added better logging. Please update to v7.7.2 and share your new log

@Mbucari

1) Will errors like this throw the process queue into a retry loop?

2) When testing pdf downloads I'm occasionally getting weird blocking. I don't see where a race cond. is possible but I do see this potentially blocking UI call which gives me pause with our heavily async workflow: ProcessQueueControl.cs -- WriteLine(string text) . It seems like it should either write to UI in a non-blocking way. Or the non-blocking code could be added to LogMe since that's the only place that calls WriteLine.

Mbucari commented 2 years ago
  1. That could happen if the user has chosen the "Retry book later..." option in their settings. The book fails, process queue checks configuration for what to do and sees it's supposed to retry later on failure, book is added to end of queue, loop ensues.
  2. I've yet to run into that problem, but I added made LogMe async. I'm not sure if this will solve the problem, but doing this in other places in the Process Queue has fixed hang issues before. https://github.com/rmcrackan/Libation/pull/255/commits/ee62d9ae8de52929d5513cade4ac250e1b9a6c4a
rmcrackan commented 2 years ago

@badbob001

In your settings on the Download/Decrypt tab, which radio button is selected at the top?

@Mbucari

1) I thought the loop got all books, iterated through the list, then stopped. If this were the workflow, it would retry once per liberate loop, but not over and over within the same loop. Am I remembering wrong?

2) Good idea. Gracias.

Mbucari commented 2 years ago

once per liberate loop, but not over and over within the same loop.

TBH I never used the Liberate All workflow; I only use the individual book method, so that nuance escaped me. So if "Retry" is selected when a failure happens, just do nothing and let the user re-queue later?

rmcrackan commented 2 years ago

If Retry is selected, then during 'liberate all' the previously failed book will get retried once. It shouldn't get stuck in a retry loop. His final step "Same item is added to queue repeatedly" shouldn't be happening. In fact, I don't know how it is. I'm hoping the new logs will shed some light.

Mbucari commented 2 years ago

It happens because of this line inside ProcessQueueControl.QueueLoop

if (result == ProcessBookResult.FailedRetry)
                    Queue.Enqueue(nextBook);

I'll remove that.

rmcrackan commented 2 years ago

@badbob001 The repeat bug is now fixed so I'm going to close this bug. However, if you reply here I'll still see it and will continue to work through this with you. I suspect the underlying error in your log is account-specific.

badbob001 commented 2 years ago

The latest version fixes the endless queue issue. Checked the item on audible and the item is no longer accessible in my library. I do have other items that are not in my library anymore they don't cause the popup error. I guess this item is different because it also has a PDF.