Commit 2e84c0d
committed
fix(plugin): split exception groups, drain before the build
A BaseExceptionGroup is neither case the containment boundary tested. A group
carrying a KeyboardInterrupt is not an instance of one, so the tuple handler
naming the three did not match it and the broad handler contained the
interrupt inside it. Plugin code produces such a group without asking:
an asyncio.TaskGroup whose task is interrupted raises one.
Both boundaries now partition what plugin code raised. The control leaves are
returned to the caller and re-raised; what remains is logged as a contained
plugin failure. A group of ordinary failures is therefore contained whole,
and a mixed group is logged and then propagates only its control part. The
end-hook dispatch catches BaseException rather than naming the three, because
everything reaching it has already been partitioned.
Insight registers its invocation-end drain on entering the hook rather than
after building the record. _emit runs customer code, and a content transform
raising a BaseException escapes _apply_data_content, which contains only
Exception. That failure left the hook with the drain unrequested, so records
this execution had already scheduled stayed in a buffering exporter when the
environment froze.1 parent 84159aa commit 2e84c0d
4 files changed
Lines changed: 200 additions & 32 deletions
File tree
- packages
- aws-durable-execution-sdk-python-insight
- src/aws_durable_execution_sdk_python_insight
- tests
- aws-durable-execution-sdk-python
- src/aws_durable_execution_sdk_python
- tests
Lines changed: 17 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
392 | 402 | | |
393 | 403 | | |
394 | 404 | | |
| |||
447 | 457 | | |
448 | 458 | | |
449 | 459 | | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
456 | 467 | | |
457 | 468 | | |
458 | 469 | | |
| |||
Lines changed: 53 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| 29 | + | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| |||
680 | 683 | | |
681 | 684 | | |
682 | 685 | | |
| 686 | + | |
683 | 687 | | |
684 | 688 | | |
685 | 689 | | |
| |||
690 | 694 | | |
691 | 695 | | |
692 | 696 | | |
693 | | - | |
| 697 | + | |
| 698 | + | |
694 | 699 | | |
695 | 700 | | |
696 | 701 | | |
| |||
1188 | 1193 | | |
1189 | 1194 | | |
1190 | 1195 | | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
1191 | 1243 | | |
1192 | 1244 | | |
1193 | 1245 | | |
| |||
Lines changed: 62 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
548 | 578 | | |
549 | 579 | | |
550 | 580 | | |
| |||
632 | 662 | | |
633 | 663 | | |
634 | 664 | | |
635 | | - | |
| 665 | + | |
636 | 666 | | |
637 | | - | |
638 | | - | |
639 | | - | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
640 | 671 | | |
641 | 672 | | |
642 | 673 | | |
643 | 674 | | |
644 | 675 | | |
645 | 676 | | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
652 | 680 | | |
| 681 | + | |
| 682 | + | |
653 | 683 | | |
654 | 684 | | |
655 | 685 | | |
| |||
678 | 708 | | |
679 | 709 | | |
680 | 710 | | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
686 | 716 | | |
687 | 717 | | |
688 | 718 | | |
| |||
702 | 732 | | |
703 | 733 | | |
704 | 734 | | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
710 | 741 | | |
711 | 742 | | |
712 | 743 | | |
| |||
725 | 756 | | |
726 | 757 | | |
727 | 758 | | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
732 | 763 | | |
733 | 764 | | |
734 | 765 | | |
735 | 766 | | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
736 | 773 | | |
737 | 774 | | |
738 | 775 | | |
| |||
752 | 789 | | |
753 | 790 | | |
754 | 791 | | |
755 | | - | |
| 792 | + | |
756 | 793 | | |
757 | 794 | | |
758 | 795 | | |
| |||
Lines changed: 68 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
647 | 647 | | |
648 | 648 | | |
649 | 649 | | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 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 | + | |
| 706 | + | |
| 707 | + | |
650 | 708 | | |
651 | 709 | | |
652 | 710 | | |
| |||
2380 | 2438 | | |
2381 | 2439 | | |
2382 | 2440 | | |
| 2441 | + | |
| 2442 | + | |
| 2443 | + | |
| 2444 | + | |
| 2445 | + | |
| 2446 | + | |
| 2447 | + | |
| 2448 | + | |
| 2449 | + | |
| 2450 | + | |
2383 | 2451 | | |
2384 | 2452 | | |
2385 | 2453 | | |
| |||
0 commit comments