You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
'There is no Container instance available at this time.\nThis is likely because you have reached your max concurrent instance count (set in wrangler config) or are you currently provisioning the Container.\nIf you are deploying your Container for the first time, check your dashboard to see provisioning status, this may take a few minutes.',
760
+
{status: 503}
761
+
);
762
+
}
763
+
returnnewResponse(
764
+
`Failed to restart container: ${retryErrorinstanceofError ? retryError.message : String(retryError)}`,
765
+
{status: 500}
766
+
);
767
+
}
768
+
}
769
+
724
770
// This error means that the container might've just restarted
0 commit comments