Commit bde0a0a
committed
Fix race condition with sending a request while container is stopping
Due to some quirks in the runtime, it's possible for the DO to send a
request to a container when it thinks the container is in a running
state, but while the request is in flight, the container stops and the
monitor promise resolves. This results in an error, and instead of
retrying we throw a 500 error. Instead, recognize this case and restart
the container.
This is a bandage solution, but we will follow up with some improvements
to the runtime that will clean up the state management required in this
DO class.1 parent 0b6112f commit bde0a0a
1 file changed
+27
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
80 | 88 | | |
81 | 89 | | |
82 | 90 | | |
| |||
721 | 729 | | |
722 | 730 | | |
723 | 731 | | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
724 | 751 | | |
725 | 752 | | |
726 | 753 | | |
| |||
0 commit comments