Commit a2511ff
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 01873aa.
* Revert "Added Cache Instructions lock, to avoid deadlocks"
This reverts commit e3fca7c.
* 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>
(cherry picked from commit 2c23e67)1 parent 8e837d3 commit a2511ff
File tree
10 files changed
+129
-38
lines changed- src
- Umbraco.Cms.Persistence.SqlServer/Services
- Umbraco.Cms.Persistence.Sqlite/Services
- Umbraco.Core/Cache
- Umbraco.Infrastructure
- Persistence
- Scoping
- Umbraco.PublishedCache.NuCache
- Persistence
- tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence
10 files changed
+129
-38
lines changedLines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
| 140 | + | |
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| |||
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
172 | | - | |
| 173 | + | |
173 | 174 | | |
174 | | - | |
| 175 | + | |
| 176 | + | |
175 | 177 | | |
176 | 178 | | |
177 | 179 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| |||
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
36 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
| |||
195 | 201 | | |
196 | 202 | | |
197 | 203 | | |
198 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
199 | 208 | | |
200 | 209 | | |
201 | 210 | | |
| |||
223 | 232 | | |
224 | 233 | | |
225 | 234 | | |
226 | | - | |
227 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
228 | 239 | | |
229 | 240 | | |
230 | 241 | | |
| |||
259 | 270 | | |
260 | 271 | | |
261 | 272 | | |
262 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
263 | 277 | | |
264 | 278 | | |
265 | 279 | | |
| |||
296 | 310 | | |
297 | 311 | | |
298 | 312 | | |
299 | | - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
300 | 317 | | |
301 | 318 | | |
302 | 319 | | |
| |||
338 | 355 | | |
339 | 356 | | |
340 | 357 | | |
341 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
342 | 362 | | |
343 | 363 | | |
344 | 364 | | |
| |||
365 | 385 | | |
366 | 386 | | |
367 | 387 | | |
368 | | - | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
369 | 392 | | |
370 | 393 | | |
371 | 394 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
36 | 40 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
227 | 235 | | |
228 | 236 | | |
229 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
| 28 | + | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
| |||
87 | 86 | | |
88 | 87 | | |
89 | 88 | | |
90 | | - | |
91 | 89 | | |
92 | 90 | | |
93 | 91 | | |
| |||
562 | 560 | | |
563 | 561 | | |
564 | 562 | | |
565 | | - | |
| 563 | + | |
566 | 564 | | |
567 | 565 | | |
568 | 566 | | |
| |||
573 | 571 | | |
574 | 572 | | |
575 | 573 | | |
576 | | - | |
| 574 | + | |
577 | 575 | | |
578 | 576 | | |
579 | 577 | | |
580 | 578 | | |
581 | 579 | | |
582 | | - | |
| 580 | + | |
583 | 581 | | |
584 | 582 | | |
585 | 583 | | |
586 | 584 | | |
587 | | - | |
| 585 | + | |
588 | 586 | | |
589 | 587 | | |
590 | 588 | | |
591 | 589 | | |
592 | 590 | | |
593 | | - | |
| 591 | + | |
594 | 592 | | |
595 | 593 | | |
596 | 594 | | |
| |||
659 | 657 | | |
660 | 658 | | |
661 | 659 | | |
662 | | - | |
| 660 | + | |
663 | 661 | | |
664 | 662 | | |
665 | 663 | | |
| |||
970 | 968 | | |
971 | 969 | | |
972 | 970 | | |
973 | | - | |
| 971 | + | |
974 | 972 | | |
975 | 973 | | |
976 | 974 | | |
| |||
1045 | 1043 | | |
1046 | 1044 | | |
1047 | 1045 | | |
1048 | | - | |
| 1046 | + | |
1049 | 1047 | | |
1050 | 1048 | | |
1051 | 1049 | | |
| |||
1061 | 1059 | | |
1062 | 1060 | | |
1063 | 1061 | | |
1064 | | - | |
| 1062 | + | |
1065 | 1063 | | |
1066 | 1064 | | |
1067 | 1065 | | |
| |||
1088 | 1086 | | |
1089 | 1087 | | |
1090 | 1088 | | |
1091 | | - | |
| 1089 | + | |
1092 | 1090 | | |
1093 | 1091 | | |
1094 | 1092 | | |
| |||
1122 | 1120 | | |
1123 | 1121 | | |
1124 | 1122 | | |
1125 | | - | |
| 1123 | + | |
1126 | 1124 | | |
1127 | 1125 | | |
1128 | 1126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| |||
330 | 332 | | |
331 | 333 | | |
332 | 334 | | |
333 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
334 | 341 | | |
335 | 342 | | |
336 | 343 | | |
| |||
Lines changed: 19 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
131 | | - | |
132 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
133 | 149 | | |
134 | 150 | | |
135 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
198 | 200 | | |
199 | 201 | | |
200 | 202 | | |
201 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
202 | 209 | | |
203 | 210 | | |
204 | 211 | | |
| |||
0 commit comments