Add user-configurable timeout to wasm http requests#133
Draft
ianthomas23 wants to merge 1 commit intomainfrom
Draft
Add user-configurable timeout to wasm http requests#133ianthomas23 wants to merge 1 commit intomainfrom
ianthomas23 wants to merge 1 commit intomainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #133 +/- ##
=======================================
Coverage 88.27% 88.27%
=======================================
Files 61 61
Lines 2627 2627
Branches 309 309
=======================================
Hits 2319 2319
Misses 308 308 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
WIP to add a timeout to wasm http requests. Such requests are synchronous blocking requests so we cannot obtain any feedback to present to the user whilst they are underway, and we have to wait until the corresponding http reply is received in full. These requests can take a long time fi they are clones of a large repo, as lots of data needs to be transferred back to us and usually this is a two-step return as it has to be via a CORS proxy. In the event of the request failing, if there isn't a timeout then the operation will block forever and
cocklewill be unresponsive forever. Note that this is the stage that occurs before the returned data is processed for which we do have progress reported to the user.Ideally we'd use an asynchronous non-blocking request for this and it is part of our long term plan to implement asynchronous emscripten-forge terminal and kernel packages, but this is not yet available and is non-trivial to implement now.
Here there is a default timeout of 10 seconds (this is TBD really) and it can be overridden by the user via an environment variable:
export GIT_HTTP_TIMEOUT=20This is a WIP as there is more to do: