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

Fix StashDB DB locked errors #1826

Closed
wants to merge 2 commits into from
Closed

Conversation

pops64
Copy link
Contributor

@pops64 pops64 commented Aug 22, 2024

Since the stashDB scraper is called directly via scrape.StashDb() through api.StashDB() and not though tasks.Scrape() All the locked code that is associated with tasks.Scrape() is not used. So DB acitions in stashDB() are being blocked. I believe this is causing errors when multiple process attempt to run as other processes lock the DB but stashDB does not and doesn't check either.

Also updated the start code to bring it more in line with how tasks.Scrape() starts as scrapeID and siteID are only used in this one instance.

Testing required to confirm squash

Since the stashDB scraper is called directly via `scrape.StashDb()` through `api.StashDB()` and not though `tasks.Scrape()` All the locked code that is associated with `tasks.Scrape()` is not used. So DB acitions in `stashDB()` are being blocked. I believe this is causing errors when multiple process attempt to run as other processes lock the DB but stashDB does not and doesn't check either.

Also updated the start code to bring it more in line with how `tasks.Scrape()` starts as `scrapeID` and `siteID` are only used in this one instance.

Testing required to confirm squash
@pops64 pops64 changed the title Should fix StashDB locked errors Fix StashDB DB locked errors Aug 22, 2024
@pops64
Copy link
Contributor Author

pops64 commented Aug 23, 2024

Not squashed yet. I am not sure where the DB is being locked up. Its happening on a Save call between MatchAkaPerformers and UpdateAllPerformerData but all the save calls have identical first prints of error messages ... I will move the lock code higher up the call stack as StashdbRunAll is truly the main thread for all stash db functionality

@pops64
Copy link
Contributor Author

pops64 commented Aug 23, 2024

I will close this for now and make a new PR once I squash this

@pops64 pops64 closed this Aug 23, 2024
@pops64 pops64 deleted the StashDB-Fix branch August 29, 2024 04:06
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.

1 participant