Commit 2422e53
committed
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.1 parent acc4f1d commit 2422e53
2 files changed
Lines changed: 71 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 | | |
658 | 707 | | |
659 | 708 | | |
| |||
| 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 | + | |
1419 | 1440 | | |
1420 | 1441 | | |
1421 | 1442 | | |
| |||
1430 | 1451 | | |
1431 | 1452 | | |
1432 | 1453 | | |
| 1454 | + | |
1433 | 1455 | | |
1434 | 1456 | | |
1435 | 1457 | | |
| |||
1444 | 1466 | | |
1445 | 1467 | | |
1446 | 1468 | | |
1447 | | - | |
1448 | | - | |
1449 | | - | |
1450 | | - | |
1451 | | - | |
1452 | | - | |
1453 | | - | |
1454 | | - | |
1455 | | - | |
1456 | | - | |
1457 | | - | |
1458 | | - | |
1459 | | - | |
1460 | | - | |
1461 | | - | |
1462 | | - | |
1463 | | - | |
1464 | 1469 | | |
1465 | 1470 | | |
1466 | 1471 | | |
| |||
0 commit comments