Commit b0d1280
committed
fix: improve QuotaExceededError recovery with stats.loaded fallback and eviction gating
The previous eviction logic never triggered because it relied on
frag.byteLength (which reads stats.total from Content-Length). While
Jellyfin does set Content-Length, stats.total can still be 0 during
progressive loading or with other servers using chunked transfer.
Switch to stats.loaded (actual bytes received, always populated after
fragment completion) with byteLength as fallback.
Additionally, progressive loading creates a new append operation per
chunk, each with its own quotaEvictionAttempted closure. This caused
every chunk to independently trigger eviction or emit BUFFER_FULL_ERROR.
Add a class-level _quotaEvictionPending flag per SourceBuffer type so
that subsequent QuotaExceededErrors piggyback on the in-flight eviction
by queuing retries behind the pending remove, avoiding redundant
evictions and suppressing the BUFFER_FULL_ERROR spam.
Changes:
- fragment-tracker: use stats.loaded as primary byte source in
getBackBufferEvictionEnd, falling back to byteLength
- buffer-controller: add _quotaEvictionPending flag gating per type
- buffer-controller: add getQuotaEvictionFlushOp that clears the
pending flag on complete/error
- buffer-controller: log warning when no back buffer is available
to evict1 parent e34dbc6 commit b0d1280
2 files changed
Lines changed: 71 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
121 | 128 | | |
122 | 129 | | |
123 | 130 | | |
| |||
907 | 914 | | |
908 | 915 | | |
909 | 916 | | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | | - | |
915 | | - | |
916 | | - | |
917 | | - | |
918 | | - | |
919 | | - | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
920 | 921 | | |
921 | | - | |
| 922 | + | |
922 | 923 | | |
923 | | - | |
924 | | - | |
925 | | - | |
926 | | - | |
927 | | - | |
928 | | - | |
| 924 | + | |
929 | 925 | | |
930 | 926 | | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
931 | 949 | | |
932 | 950 | | |
933 | 951 | | |
| |||
997 | 1015 | | |
998 | 1016 | | |
999 | 1017 | | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
1000 | 1045 | | |
1001 | 1046 | | |
1002 | 1047 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
489 | 493 | | |
490 | 494 | | |
491 | 495 | | |
| |||
503 | 507 | | |
504 | 508 | | |
505 | 509 | | |
506 | | - | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
507 | 513 | | |
508 | 514 | | |
509 | 515 | | |
| |||
525 | 531 | | |
526 | 532 | | |
527 | 533 | | |
528 | | - | |
| 534 | + | |
| 535 | + | |
529 | 536 | | |
530 | 537 | | |
531 | 538 | | |
| |||
0 commit comments