Commit a3d3b1f
authored
Combine handle_next_invocation and next_event. Don't block for PlatformReport on timeout shutdowns (#692)
1. Refactors handle_next_invocation to call next_event. The methods are
separate because we call next_event in an idle loop, but otherwise we
always call them together from main, so this simplifies things
2. In the shutdown loop, only block for the report line if the shutdown
isn't a timeout. On timeouts, we won't get a report log.
That's not a problem for most use cases where the sandbox will
re-initailize, the telemetry API will re-pass events, and then we can
forward events on the next invocation. But if a function continuosly
times out, we may not forward the custom `task timed out` log until a
few invocations down the line.
~I'll verify if this is true with OOMs~
OOMs can be variable, so i've added a new line to the END log to explain
the status reason. For node it's a runtimeExit:
<img width="941" alt="image"
src="https://github.com/user-attachments/assets/e22a56e1-9276-488d-b333-29ec644489bd"
/>1 parent 1bd3b67 commit a3d3b1f
3 files changed
Lines changed: 52 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
499 | | - | |
500 | 499 | | |
501 | 500 | | |
502 | | - | |
| 501 | + | |
503 | 502 | | |
504 | | - | |
| 503 | + | |
505 | 504 | | |
506 | 505 | | |
507 | 506 | | |
| |||
542 | 541 | | |
543 | 542 | | |
544 | 543 | | |
545 | | - | |
546 | | - | |
| 544 | + | |
| 545 | + | |
547 | 546 | | |
548 | 547 | | |
549 | 548 | | |
| |||
593 | 592 | | |
594 | 593 | | |
595 | 594 | | |
596 | | - | |
| 595 | + | |
| 596 | + | |
597 | 597 | | |
598 | 598 | | |
599 | 599 | | |
| |||
607 | 607 | | |
608 | 608 | | |
609 | 609 | | |
610 | | - | |
| 610 | + | |
611 | 611 | | |
612 | 612 | | |
613 | 613 | | |
| |||
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
632 | | - | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
633 | 636 | | |
634 | 637 | | |
635 | 638 | | |
636 | 639 | | |
637 | 640 | | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
645 | 652 | | |
646 | 653 | | |
647 | 654 | | |
| |||
759 | 766 | | |
760 | 767 | | |
761 | 768 | | |
762 | | - | |
| 769 | + | |
| 770 | + | |
763 | 771 | | |
764 | | - | |
| 772 | + | |
| 773 | + | |
765 | 774 | | |
766 | 775 | | |
767 | | - | |
| 776 | + | |
768 | 777 | | |
769 | | - | |
| 778 | + | |
770 | 779 | | |
771 | 780 | | |
772 | 781 | | |
773 | | - | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
774 | 785 | | |
775 | 786 | | |
776 | | - | |
| 787 | + | |
777 | 788 | | |
778 | | - | |
779 | 789 | | |
780 | 790 | | |
781 | | - | |
| 791 | + | |
782 | 792 | | |
783 | 793 | | |
784 | 794 | | |
785 | 795 | | |
786 | 796 | | |
787 | | - | |
788 | 797 | | |
789 | | - | |
| 798 | + | |
790 | 799 | | |
791 | 800 | | |
792 | | - | |
793 | 801 | | |
794 | 802 | | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
795 | 807 | | |
796 | 808 | | |
797 | 809 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | | - | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
| 129 | + | |
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
| |||
153 | 155 | | |
154 | 156 | | |
155 | 157 | | |
| 158 | + | |
156 | 159 | | |
157 | 160 | | |
158 | | - | |
| 161 | + | |
159 | 162 | | |
160 | 163 | | |
161 | 164 | | |
162 | 165 | | |
163 | 166 | | |
| 167 | + | |
164 | 168 | | |
165 | 169 | | |
166 | 170 | | |
167 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
168 | 176 | | |
169 | 177 | | |
170 | 178 | | |
| |||
175 | 183 | | |
176 | 184 | | |
177 | 185 | | |
| 186 | + | |
178 | 187 | | |
179 | 188 | | |
180 | 189 | | |
| |||
209 | 218 | | |
210 | 219 | | |
211 | 220 | | |
| 221 | + | |
212 | 222 | | |
213 | 223 | | |
214 | 224 | | |
| |||
522 | 532 | | |
523 | 533 | | |
524 | 534 | | |
525 | | - | |
| 535 | + | |
526 | 536 | | |
527 | 537 | | |
528 | 538 | | |
| |||
0 commit comments