Commit bac7ef4
authored
fix(nimbus): prevent kinto preview sync from clobbering concurrent user state transitions (#15619)
Because
* The kinto preview sync task hydrated experiments in memory across slow
Kinto network calls, then called experiment.save(), clobbering any
concurrent write — most visibly a Request Launch on a Preview
experiment, which appeared to succeed in the HTMX response but reverted
on refresh
* All three sections (push, expire, unpublish) had the same lost-update
shape
This commit
* Replaces experiment.save() with conditional QuerySet.update() in all
three sections, gating each write on the status the task observed and
writing only the columns it owns
* Adds regression tests for the push and expiry races
Fixes #156181 parent 6b66976 commit bac7ef4
2 files changed
Lines changed: 95 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
508 | | - | |
509 | | - | |
510 | | - | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
511 | 522 | | |
| 523 | + | |
512 | 524 | | |
513 | 525 | | |
514 | 526 | | |
| |||
525 | 537 | | |
526 | 538 | | |
527 | 539 | | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
532 | 552 | | |
| 553 | + | |
533 | 554 | | |
534 | 555 | | |
535 | 556 | | |
| |||
545 | 566 | | |
546 | 567 | | |
547 | 568 | | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
553 | 576 | | |
| 577 | + | |
554 | 578 | | |
555 | 579 | | |
556 | 580 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1666 | 1666 | | |
1667 | 1667 | | |
1668 | 1668 | | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
1669 | 1728 | | |
1670 | 1729 | | |
1671 | 1730 | | |
| |||
0 commit comments