Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve timeout handling #2242

Merged
merged 2 commits into from
Mar 4, 2024
Merged

Improve timeout handling #2242

merged 2 commits into from
Mar 4, 2024

Conversation

FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented Mar 4, 2024

This PR improves timeout handling in the SnapController and in the execution services, it makes a handful of changes:

  • Adds a timeout of 2 seconds to the ping request, sent to the execution environment after boot. This lets us fail more immediately if the execution environment has loaded but is non-responsive (e.g. if the execution env is down, the iframe loads a Chrome failure page, which still counts as the iframe loading).
  • Adds maxInitTime as a constructor argument allowing for better configuration of how long Snaps (and the execution environment) has in total to boot before timing out. Previously maxRequestTime was used for the initialization timeout.
  • Changes all of the error messaging around timeouts in an attempt to give more information than the previous vague error message: "The request timed out.".

@FrederikBolding FrederikBolding requested a review from a team as a code owner March 4, 2024 11:01
Copy link

codecov bot commented Mar 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.60%. Comparing base (4d65e1d) to head (1981693).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2242   +/-   ##
=======================================
  Coverage   96.60%   96.60%           
=======================================
  Files         337      337           
  Lines        7602     7608    +6     
  Branches     1177     1180    +3     
=======================================
+ Hits         7344     7350    +6     
  Misses        258      258           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@FrederikBolding FrederikBolding merged commit 1acb283 into main Mar 4, 2024
150 checks passed
@FrederikBolding FrederikBolding deleted the fb/ping-timeout branch March 4, 2024 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants