This repository has been archived by the owner on Aug 3, 2023. It is now read-only.
Temporary workaround to avoid dropping a tokio::runtime while another is running #1991
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes the following error from
wrangler tail
:This is a regression from #1966, since wrangler now makes API calls in more places than it used to. The panic in that file is "Cannot drop a runtime in a context where blocking is not allowed. This happens when a runtime is dropped from within an asynchronous context."
The larger issue is that there are many different runtimes in Wrangler:
wrangler tail
to watch for changesreqwest::blocking
to fetch the account ID from Cloudflare's APIcommands::dev::gcs
- not sure what this does, something to do with a persistent server?commands::dev::edge
- dittoHaving more than one runtime going at once is not great; the three in Wrangler
seem to be disjoint, but the one in cloudflare_rs absolutely overlaps with some
of the ones from wrangler.
This is a temporary workaround to avoid panics in
wrangler tail
, but I'mworking on a larger fix to cloudflare_rs to see if it can avoid spawning a new
runtime for each request.
cc @jspspike @nilslice @Electroid