Commit 6ca5b52
authored
fix(execution): release the lease when abort races an undetermined acquisition (#7237)
* fix(execution): release the lease when abort races an undetermined acquisition
The cancellation return for an aborted execution ran before `releaseLease` was
declared, so it exited without releasing. An undetermined acquisition can still
be registered by Redis after the deadline abandons the local wait, and that
member then counted against the owner for the whole TTL, denying later
executions that had capacity.
Declare the release before the early returns so every exit path that can leave a
registration behind reaches it, and call it on the cancellation path. The
over-limit return still skips it: the script answers that before its ZADD, so
nothing was ever registered.
* fix(execution): keep the over-limit abort path release-free
The abort guard fires for any non-acquired result, so an over-limit acquisition
that was already aborted also released — contradicting the rule stated two lines
below, where the same result returns without releasing because the script
answers before its ZADD. Restrict the release to undetermined results and assert
the no-release behavior in the existing over-limit abort test.1 parent e9c343d commit 6ca5b52
2 files changed
Lines changed: 76 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
654 | 654 | | |
655 | 655 | | |
656 | 656 | | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
657 | 706 | | |
| 707 | + | |
658 | 708 | | |
659 | 709 | | |
660 | 710 | | |
| |||
670 | 720 | | |
671 | 721 | | |
672 | 722 | | |
| 723 | + | |
673 | 724 | | |
674 | 725 | | |
675 | 726 | | |
| |||
699 | 750 | | |
700 | 751 | | |
701 | 752 | | |
| 753 | + | |
| 754 | + | |
702 | 755 | | |
703 | 756 | | |
704 | 757 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1415 | 1415 | | |
1416 | 1416 | | |
1417 | 1417 | | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
1418 | 1438 | | |
| 1439 | + | |
| 1440 | + | |
1419 | 1441 | | |
1420 | 1442 | | |
1421 | 1443 | | |
| |||
1430 | 1452 | | |
1431 | 1453 | | |
1432 | 1454 | | |
| 1455 | + | |
1433 | 1456 | | |
1434 | 1457 | | |
1435 | 1458 | | |
| |||
1444 | 1467 | | |
1445 | 1468 | | |
1446 | 1469 | | |
1447 | | - | |
1448 | | - | |
1449 | | - | |
1450 | | - | |
1451 | | - | |
1452 | | - | |
1453 | | - | |
1454 | | - | |
1455 | | - | |
1456 | | - | |
1457 | | - | |
1458 | | - | |
1459 | | - | |
1460 | | - | |
1461 | | - | |
1462 | | - | |
1463 | | - | |
1464 | 1470 | | |
1465 | 1471 | | |
1466 | 1472 | | |
| |||
0 commit comments