Skip to content

Error Handling controller and LoadPolicies - #5241

Merged
robwalch merged 11 commits into
masterfrom
feature/error-controller-pathway-penalty-network-policy
Feb 27, 2023
Merged

robwalch merged 11 commits into
masterfrom
feature/error-controller-pathway-penalty-network-policy

Conversation

@robwalch

@robwalch robwalch commented Feb 18, 2023 •

Copy link
Copy Markdown
Collaborator

This PR will...

Implement an ErrorController to handle error events before and after other controllers. On ERROR, ErrorController is responsible for level switching, falling back to redundant streams, and escalating errors to fatal when there is no action to take.

  • Handle missed probe transmux probe with with FRAG_PARSING_ERROR
  • Handle encrypted init segment and subtitle decryption failure with FRAG_DECRYPT_ERROR
  • Remove delay when retrying after timeout
  • Trigger FRAG_LOADING after request is made
  • All ERROR event data type must include an error property
  • Add stats to network loader error callbacks to allow error handling to use request timing
  • Remove use of console.warn from mp4-tools
  • Add missing TypeScript type exports
  • Switch Pathways after all fallback options are exhausted
  • Failed Pathways go into a penalty box for 5 minutes

Why is this Pull Request needed?

Improve error handling and consolidate error handling logic so that it is easier to follow, and so that it can be replaced with a custom controller.

Completes Content Steering by implementing Pathway penalty and switching on error.

Are there any points in the code the reviewer needs to double check?

Resolves issues:

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

@robwalch robwalch added this to the 1.4.0 milestone Feb 18, 2023
@robwalch robwalch mentioned this pull request Feb 18, 2023
3 tasks done
@robwalch
robwalch force-pushed the feature/error-controller-pathway-penalty-network-policy branch from e49ff5c to 1116105 Compare February 18, 2023 20:18
Base automatically changed from feature/content-steering to master February 18, 2023 20:20
@robwalch
robwalch force-pushed the feature/error-controller-pathway-penalty-network-policy branch 4 times, most recently from 8d1b80e to bba791b Compare February 22, 2023 01:08
@robwalch
robwalch marked this pull request as ready for review February 22, 2023 01:09
Add Error Handling Integration Tests
Handle missed probe transmux probe with with FRAG_PARSING_ERROR
Handle encrypted init segment and subtitle decryption failure with FRAG_DECRYPT_ERROR
Remove delay when retrying after timeout
Trigger FRAG_LOADING after request is made
ERROR event data type must include an error property
Add stats to network loader error callbacks to allow error handling to use request timing
Remove use of console.warn from mp4-tools
Add missing TypeScript type exports
Warn on currentFrag context reference change and use currentFrag to maintain correct stats ref
Fixes #5230
Comment thread src/utils/error-helper.ts Resolved
@robwalch
robwalch force-pushed the feature/error-controller-pathway-penalty-network-policy branch from 33224cf to d23e53a Compare February 24, 2023 21:39
@robwalch
robwalch force-pushed the feature/error-controller-pathway-penalty-network-policy branch from d23e53a to 90984f9 Compare February 25, 2023 00:14
@robwalch
robwalch force-pushed the feature/error-controller-pathway-penalty-network-policy branch from e629562 to 981875c Compare February 25, 2023 03:32
@robwalch
robwalch merged commit 8063580 into master Feb 27, 2023
@robwalch
robwalch deleted the feature/error-controller-pathway-penalty-network-policy branch February 27, 2023 19:31
@robwalch robwalch mentioned this pull request Mar 9, 2023
3 tasks done
akashchamp pushed a commit to akashchamp/hls.js that referenced this pull request Sep 25, 2026
* Implement ErrorController …
Add Error Handling Integration Tests
Handle missed probe transmux probe with with FRAG_PARSING_ERROR
Handle encrypted init segment and subtitle decryption failure with FRAG_DECRYPT_ERROR
Remove delay when retrying after timeout
Trigger FRAG_LOADING after request is made
ERROR event data type must include an error property
Add stats to network loader error callbacks to allow error handling to use request timing
Remove use of console.warn from mp4-tools
Add missing TypeScript type exports

* Remove console.assert statements
Resolves video-dev#5218
Closes video-dev#5221

* Remove unused frag buffered monitor

* Add Load Policies and deprecate frag/level/manifest timeout and retry config options

* Switch on FRAG_PARSING_ERROR or continue trying fragLoadPolicy.default.errorRetry.maxNumRetry (6) times
Fixes video-dev#5011

* Switch on FRAG_PARSING_ERROR or continue trying fragLoadPolicy.default.errorRetry.maxNumRetry (6) times 2/2
Fixes video-dev#5011

* Do not reload level after calling stopLoad() and startLoad()
Warn on currentFrag context reference change and use currentFrag to maintain correct stats ref
Fixes video-dev#5230

* Implement ErrorActions and Pathway Switching

* Fix part timeout handling
Cleanup frag stats handoff

* Update retry rules to require http status or timeout error (deprioritizes retry on parse errors)

* Retry audio and subtitle playlist loading after failure on level switch when no alternate is available
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant