Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid multiple concurrent extractions of the same archive v2 #2921

Conversation

SamuelBMartins
Copy link
Contributor

@SamuelBMartins SamuelBMartins commented Apr 28, 2024

Fixed

@SamuelBMartins
Copy link
Contributor Author

This is a continuation of the PR #2840.

This time I used an ConcurrentDictionary<int, SemaphoreSlim> so that every chapter uses a different Semaphore. The dictionary keeps every Semaphore ever used in memory since the semaphore is needed not only for creating the cache but also checking if the cache exists in successive request. I have another branch bugfix/concurrent-extraction2-2 where I try to keep the number of entries in the dictionary low. However, I'm not sure this alternative is better since for each page requested, even if already cached, I need to create a new semaphore.

@majora2007 Can you check if you notice a slowdown with this solution? If there are some automated benchmarks I can run them myself.

@majora2007 majora2007 added this to In progress in v0.8 - PDF & Comic Love via automation Apr 28, 2024
@majora2007 majora2007 moved this from In progress to To do in v0.8 - PDF & Comic Love May 2, 2024
@majora2007
Copy link
Member

Hey, sorry haven't gotten around to this. Been pretty swamped irl. There is another PR from Robbie with reader changes. Going to combine these and deploy them to my prod instance to give a good shakeout this week.

@majora2007
Copy link
Member

Looking good so far, nothing stood out. I yet again manually merged this into another branch that will be merged, then I will close this PR.

@majora2007
Copy link
Member

This was merged here:
#2960

@majora2007 majora2007 closed this May 22, 2024
v0.8 - PDF & Comic Love automation moved this from To do to Done May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Chapters starting halfway through and repeating pages Tachiyomi volume downloads sometimes missing pages
2 participants