Commit 3cbb202
committed
fix(plugin): pair the end hook with the start hook
A start hook raising one of the three exceptions that instruct the calling
thread to stop propagates out of the dispatch loop, so plugins later in the
list never receive their start hook. The invocation-end hook that the
propagating exception then triggers reached them anyway, leaving a plugin to
tear down state it had never been told to build.
Hooks after the start hook are now dispatched to the plugins that received
the start hook, which makes the pairing an invariant rather than a
coincidence. A plugin counts as started before its hook is dispatched,
because a hook that begins and then fails may already have allocated what
its end hook releases.
A refused drain also requests a flush now. An exporter that re-enters a
plugin hook can queue a record from the export worker, and drain() refuses
the wait that hook makes. The worker exits its loop once nothing is pending
and no flush is requested, so the record reached the exporters and the
worker stopped, leaving a buffering exporter holding an execution's terminal
telemetry when Lambda froze the environment. The request is made without
waiting, so the worker stays unblocked, and its barrier covers the record
just queued.1 parent ac786f6 commit 3cbb202
4 files changed
Lines changed: 92 additions & 5 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: 24 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
205 | | - | |
| 204 | + | |
| 205 | + | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
214 | 222 | | |
215 | 223 | | |
216 | 224 | | |
| |||
286 | 294 | | |
287 | 295 | | |
288 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
289 | 311 | | |
290 | 312 | | |
291 | 313 | | |
| |||
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
903 | 903 | | |
904 | 904 | | |
905 | 905 | | |
| 906 | + | |
906 | 907 | | |
907 | 908 | | |
908 | | - | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
909 | 916 | | |
910 | 917 | | |
911 | | - | |
| |||
Lines changed: 24 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
572 | 576 | | |
573 | 577 | | |
574 | 578 | | |
| |||
611 | 615 | | |
612 | 616 | | |
613 | 617 | | |
| 618 | + | |
614 | 619 | | |
615 | 620 | | |
616 | 621 | | |
| |||
704 | 709 | | |
705 | 710 | | |
706 | 711 | | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
707 | 727 | | |
708 | 728 | | |
709 | | - | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
710 | 733 | | |
711 | 734 | | |
712 | 735 | | |
| |||
Lines changed: 36 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 | + | |
650 | 679 | | |
651 | 680 | | |
652 | 681 | | |
| |||
2335 | 2364 | | |
2336 | 2365 | | |
2337 | 2366 | | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
2338 | 2374 | | |
2339 | 2375 | | |
2340 | 2376 | | |
| |||
0 commit comments