-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 ConcurrencyException with Sitemaps when saving two content items at once (Lombiq Technologies: GOV-33) #15777
Conversation
{ | ||
throw new TimeoutException($"Couldn't acquire a lock to update the sitemap within {timeout.Seconds} seconds."); | ||
} | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can remove the else here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR fixes the immediate problem. But I think at some point we should add these documents to an index and then use background task to update the site map in bulk.
Locking during publish will slow down publishing for a busy site.
src/OrchardCore.Modules/OrchardCore.Contents/Sitemaps/ContentTypesSitemapUpdateHandler.cs
Outdated
Show resolved
Hide resolved
Yeah, I thought about doing background processing like it happens with indexing. Why I didn't go down that route, apart from it being much more complex, is that compared to indexing, such sitemap updates should be much quicker and don't inherently require such batch processing. |
We'll yeah but if you are publishing/unpublishing very frequently, now every request will cause a lock. Again you do not need to implement it here. But I think we should submit an issue so it is tracked and one day this will be converted. At least we know there is an issue that should be addressed at some point. |
Done: #15783. |
Fixes #15743