Commit Graph

30 Commits

Author SHA1 Message Date
Ronald Barendse
30b114d538 Fix ContentStore locking exceptions in async code (#17246)
* Add ContentCache test

* Use SemaphoreSlim as write lock

* Apply lock imrpovements to SnapDictionary

* Obsolete unused MonitorLock

(cherry picked from commit c3db3457e7)
2024-10-11 09:47:31 +02:00
Bjarke Berg
2c23e67c65 Fixing locking issues for document type saves. (#15854)
* Added  ExecuteNonQuery(DbCommand command) on database to ensure we call OnExecutingCommand and OnExecutedCommand when executing DbCommands

* Added Cache Instructions lock, to avoid deadlocks

* Optimized read locks for nucache when only one content type is rebuilt

* Optimized the SqlServer locks, so only one command is executed (and thereby roundtrip) per lock instead of two

* Avoid breaking changes

* Cosmetic changes

* Take locks if everything is rebuild

* Use same lock in scopes, to avoid potential deadlocks between the two

* Use eager locks in PublishedSnapshotService.cs

* Added timeouts to some of the application locks

* Revert "Use eager locks in PublishedSnapshotService.cs"

This reverts commit 01873aae978ffa6e6686d253e482c493715e3a96.

* Revert "Added Cache Instructions lock, to avoid deadlocks"

This reverts commit e3fca7c12a804bb32ca1156b8abd42a957e9dc21.

* Use single readlock call to lock many

* Use eager locks for reads

* Eager write locks

* Ignore test of lazy locks

* Unique timeout exception messages

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-03-15 10:56:02 +01:00
Kenn Jacobsen
4781fb1d8b Ensure content types are updated in ContentStore when a data type changes (#15239) 2023-11-17 10:37:23 +01:00
Nikolaj Geisle
29961d40a3 V10: fix build warnings nucache (#12500)
* Run code cleanup

* Finish dotnet format and manual cleanup

* Fix according to review

Co-authored-by: Zeegaan <nge@umbraco.dk>
2022-06-20 09:21:08 +02:00
Paul Johnson
95aa143db0 v10 make migration from v9 less painful WRT IScope (#12293)
* Restore IEventDispatcher

* Fix breaking changes WRT IScopeProvider and IScope

* Update internal usage.

* Update src/Umbraco.Core/Services/UserService.cs

* Better obsolete message

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2022-04-26 10:22:37 +01:00
Nikolaj Geisle
b67810cc69 Fix new warnings 2022-04-21 11:20:12 +02:00
Nikolaj Geisle
060e0181a7 Merge remote-tracking branch 'origin/v10/dev' into v10/feature/nullable-reference-types-in-Umbraco.Web.Backoffice
# Conflicts:
#	src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs
#	src/Umbraco.Core/Extensions/PublishedContentExtensions.cs
#	src/Umbraco.Core/Telemetry/Models/TelemetryReportData.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/MultiUrlPickerValueConverter.cs
#	src/Umbraco.PublishedCache.NuCache/ContentStore.cs
#	src/Umbraco.Web.BackOffice/Trees/MemberTypeTreeController.cs
#	src/Umbraco.Web.Common/ModelsBuilder/InMemoryModelFactory.cs
#	src/Umbraco.Web.Common/Security/MemberManager.cs
#	src/Umbraco.Web.Website/Routing/ControllerActionSearcher.cs
#	src/Umbraco.Web.Website/Routing/IControllerActionSearcher.cs
#	src/Umbraco.Web.Website/Routing/UmbracoRouteValueTransformer.cs
2022-04-21 10:26:51 +02:00
Robert Foster
bef052ad3a V9/tmp nucache lock (#12149)
* wrapping SetAllFastSortedLocked in try catch

* Potential issue mitigation by retrieving all data from the database at once instead of one at a time while populating the NuCache file.

* Moved content retrieval to within the try-catch block.

* using InGroupsOf() to retrieve content without loading absolutely everything into memory.

* added "old" method signatures to prevent breaking change in ContentStore

* Revert code style cleanups for clarity

Co-authored-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
2022-04-19 13:01:38 +02:00
Paul Johnson
80c90f23d1 Fix issue - changing a document type broke the nucache data structure (#12209)
(cherry picked from commit 15df448274edb291ae568148c61baa7541615247)
2022-04-06 08:42:10 +01:00
Nikolaj Geisle
05a08bef63 Add nullability to nucache & lucene projects 2022-03-30 13:34:56 +02:00
Chad Currie
6b3a589aa0 Check Debug logs are enabled for hot path 2022-03-02 02:06:52 +01:00
Sebastiaan Janssen
692f952293 Merge branch 'v9/contrib' into v9/dev
# Conflicts:
#	src/Umbraco.Web.BackOffice/Controllers/ContentTypeController.cs
2021-11-03 13:05:43 +01:00
Shannon Deminick
c77dc5dc00 Migrating tests that depend on Published Cache from the old test project (#11242)
* starts cleaning up old test project, removing ones we'll never convert, moves new test to where it should be.

* Makes ContentNodeKit immutable properties, moves first nucache tests over

* Gets the Nucache unit tests working and refactors a bit to use builder pattern for models.

* Migrates first xml based cache test to use nucache.

* Migrates a bunch more

* Migrates remaining tests for PublishedContentTests

* Moves PublishedRouterTests

* Moves PublishedContentExtensionTests

* Moves more tests.

* committing wip

* committing wip

* Gets PublishedContentLanguageVariantTests converted and working.

* Fixes DataTable ext method and moves PublishedContentDataTableTests

* Moves PublishedMediaTests

* wip - moving EntityXmlSerializerTests

* Moves more tests

* moves more tests

* moves more tests

* Move another test

* Moves more tests

* Fix test

* move another test

* Moves more tests

* Moves more tests

* Moves more tests

* wip before merge

* More tests

* More tests

* More tests

* More tests

* More tests

* More tests

* Cleanup and moving classes.

* Remove unused code

* Fixed failing tests, due to new null checks, that did not exist in v8

* Avoid breaking changes

* Unbreak more things, even that it the old solution was crazy..

* Fixed bug where ordering of stream readings was changed..

* cleanup

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-10-19 14:11:54 +02:00
Chad Currie
9457d73499 Avoid mixing using of string interpolation and string formatting. MessageFormat parameter is cached and should be a constant string. 2021-08-15 18:51:26 +12:00
Mole
48e1ba2127 Align namespaces in Scoping to Umbraco.Cms.Core 2021-02-15 11:41:12 +01:00
Mole
737b471647 Adjust namespace in Umbraco.PublishedCache.NuCache 2021-02-10 10:46:52 +01:00
Mole
216fb87c79 Rename Umbraco.Core namespace to Umbraco.Cms.Core 2021-02-09 10:22:42 +01:00
Shannon
c761fa0506 New IPublishedSnapshotStatus, reduces IPublishedSnapshotService 2020-12-21 17:41:12 +11:00
Shannon
b5e3bc9e0d Fix the UmbracoViewPage and view model binding, combine the tests cases, remove IPublishedContentType2, front end is rendering 2020-12-11 14:55:19 +11:00
Bjarke Berg
85c01d9905 Merge remote-tracking branch 'origin/netcore/dev' into netcore/netcore
# Conflicts:
#	src/Umbraco.Configuration/Legacy/GlobalSettings.cs
#	src/Umbraco.Core/Configuration/IGlobalSettings.cs
#	src/Umbraco.Core/Models/ContentBaseExtensions.cs
#	src/Umbraco.Core/Routing/ContentFinderByRedirectUrl.cs
#	src/Umbraco.Core/Routing/DefaultUrlProvider.cs
#	src/Umbraco.Core/Runtime/MainDom.cs
#	src/Umbraco.Core/Services/IRuntimeState.cs
#	src/Umbraco.Infrastructure/Compose/NotificationsComponent.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs
#	src/Umbraco.Infrastructure/RuntimeState.cs
#	src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs
#	src/Umbraco.Tests/Runtimes/StandaloneTests.cs
#	src/Umbraco.Tests/TestHelpers/TestObjects.cs
#	src/Umbraco.Web.BackOffice/Controllers/LogViewerController.cs
#	src/Umbraco.Web.BackOffice/Controllers/UsersController.cs
#	src/Umbraco.Web.BackOffice/Mapping/ContentMapDefinition.cs
#	src/Umbraco.Web.BackOffice/PropertyEditors/RteEmbedController.cs
#	src/Umbraco.Web.BackOffice/Trees/DictionaryTreeController.cs
#	src/Umbraco.Web.UI.NetCore/umbraco/UmbracoBackOffice/Default.cshtml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/da.xml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en_us.xml
#	src/Umbraco.Web.UI/Umbraco/config/lang/cs.xml
#	src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Rte.cshtml
#	src/Umbraco.Web/Controllers/UmbLoginController.cs
#	src/Umbraco.Web/Install/Controllers/InstallController.cs
#	src/Umbraco.Web/PublishedElementExtensions.cs
#	src/Umbraco.Web/Runtime/WebInitialComposer.cs
#	src/Umbraco.Web/UmbracoHelper.cs
#	src/Umbraco.Web/UmbracoInjectedModule.cs
#	src/Umbraco.Web/UrlHelperExtensions.cs
#	src/Umbraco.Web/UrlHelperRenderExtensions.cs
#	src/Umbraco.Web/WebApi/UmbracoApiControllerBase.cs
2020-12-01 11:34:13 +01:00
Bjarke Berg
c88c842d47 Merge remote-tracking branch 'origin/v8/dev' into netcore/dev
# Conflicts:
#	.github/workflows/codeql-analysis.yml
#	src/Umbraco.Core/CompositionExtensions.cs
#	src/Umbraco.Core/Constants-AppSettings.cs
#	src/Umbraco.Core/GuidUdi.cs
#	src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs
#	src/Umbraco.Core/PublishedContentExtensions.cs
#	src/Umbraco.Core/Routing/DefaultUrlProvider.cs
#	src/Umbraco.Core/Routing/UrlProvider.cs
#	src/Umbraco.Core/Routing/UrlProviderExtensions.cs
#	src/Umbraco.Core/Runtime/MainDom.cs
#	src/Umbraco.Core/Services/IRuntimeState.cs
#	src/Umbraco.Core/StringExtensions.cs
#	src/Umbraco.Core/Sync/ApplicationUrlHelper.cs
#	src/Umbraco.Core/Sync/DatabaseServerRegistrar.cs
#	src/Umbraco.Core/Sync/IServerRegistrar.cs
#	src/Umbraco.Infrastructure/Media/EmbedProviders/Instagram.cs
#	src/Umbraco.Infrastructure/Models/ContentBaseExtensions.cs
#	src/Umbraco.Infrastructure/PropertyEditors/NestedContentPropertyEditor.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValue.cs
#	src/Umbraco.Tests/Misc/ApplicationUrlHelperTests.cs
#	src/Umbraco.Tests/Routing/UrlProviderTests.cs
#	src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs
#	src/Umbraco.Tests/TestHelpers/TestObjects.cs
#	src/Umbraco.Web.UI/Umbraco/Views/Default.cshtml
#	src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Rte.cshtml
#	src/Umbraco.Web/CompositionExtensions.cs
#	src/Umbraco.Web/HtmlHelperBackOfficeExtensions.cs
#	src/Umbraco.Web/ImageCropperTemplateExtensions.cs
#	src/Umbraco.Web/Models/Mapping/ContentMapDefinition.cs
#	src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs
#	src/Umbraco.Web/PublishedContentExtensions.cs
#	src/Umbraco.Web/Runtime/WebInitialComponent.cs
#	src/Umbraco.Web/Runtime/WebInitialComposer.cs
#	src/Umbraco.Web/Templates/TemplateUtilities.cs
#	src/Umbraco.Web/UmbracoContext.cs
#	src/Umbraco.Web/UmbracoHelper.cs
#	src/Umbraco.Web/UmbracoInjectedModule.cs
2020-11-30 11:24:24 +01:00
Mole
d750d2c2c1 Use generic logger more places and clean up 2020-09-28 14:59:17 +02:00
Nikolaj
0238d6eb02 Start using LoggerFactory 2020-09-15 12:40:35 +02:00
Nikolaj
02828db8fd Add work on PublishedSnapshotService 2020-09-15 08:45:40 +02:00
Nikolaj
a1ecc4a5c9 Change Warn to LogWarning 2020-09-14 10:17:32 +02:00
Nikolaj
d7e3bce741 Rename Error to align it with MS ILogger 2020-09-14 09:10:53 +02:00
Bjarke Berg
39162f0f6a Merge conflicts resolved 2020-08-06 12:59:21 +02:00
Bjarke Berg
bf1784f9d1 Merge remote-tracking branch 'origin/v8/dev' into netcore/dev
# Conflicts:
#	src/Umbraco.Core/ContentExtensions.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DocumentRepository.cs
2020-04-17 11:43:04 +02:00
Bjarke Berg
3406bdb40b Merge remote-tracking branch 'origin/v8/dev' into netcore/dev
# Conflicts:
#	NuGet.Config
#	src/Umbraco.Core/Models/RelationType.cs
#	src/Umbraco.Infrastructure/PropertyEditors/MediaPickerPropertyEditor.cs
2020-04-16 19:00:51 +02:00
Bjarke Berg
d147b182ee Renamed the project to Umbraco.PublishedCache.NuCache - and move non NuCache related stuff to abstractions and infrastructure. 2020-02-06 14:40:46 +01:00