Repository navigation
Commit 1367800
fix(tenancy): detach what the database refused; bound the flights
EF keeps a failed entry in the state it had, so an Added row a uniqueness
violation refused stays Added. A caller that turns the conflict into Result.Fail
and carries on writing therefore has the rejected INSERT still queued, and the
next SaveChanges on the same context re-sends it — the row is gone from the
database, and the tracker is a claim that outlived its subject.
Reachable through nesting, which ADR-0040 permits: an outer handler may absorb an
inner failure and keep going on the same scope, and the scope is one DbContext.
Added entries only — a Modified entry's original values are what the database
still holds, so detaching it would discard a change the caller may retry.
The resolver's coalescing remark now says what bounds the flights, because the
dictionary does not: a flight is retired in the read's finally, so its size is
lookups in flight rather than hosts ever seen, and the ceiling is the Npgsql pool.
A distributed flood of novel hostnames degrades into queueing there — the rate
limiter bounds one peer, the negative cache bounds repeats, neither bounds first
sight — and the admission gate that would is named rather than built, because its
trigger is a measurement nobody has taken.
Module: Tenancy
ADR: 0040
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 6172a8b commit 1367800
3 files changed
Lines changed: 89 additions & 0 deletions
File tree
- backend
- src
- LearnStack.Infrastructure/MultiTenancy
- Modules/Tenancy/LearnStack.Modules.Tenancy.Infrastructure/Persistence
- tests/LearnStack.Tests.Integration/Database
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
122 | 133 | | |
123 | 134 | | |
124 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
128 | 150 | | |
129 | 151 | | |
130 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
417 | 418 | | |
418 | 419 | | |
419 | 420 | | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
420 | 476 | | |
421 | 477 | | |
422 | 478 | | |
| |||
0 commit comments