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

Don't use AbortSignal::Follow in fetch and cache-storage #39951

Merged
merged 1 commit into from
May 17, 2023

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented May 10, 2023

AbortSignal's "follow" algorithm is replaced with a new algorithm for
creating a dependent abort signal ([1], [2]), which is implemented as
a new AbortSignal constructor. This CL replaces Follow with the new
ctor, behind the AbortSignalAny REF.

There is a slight compat risk with the change (when the feature ships):

  1. fetch: abort is propagated to dependent signals after abort event
    dispatch for a signal, whereas "follow" propagated abort before (as
    abort algorithms), which is observable. We could alternatively use
    weak abort algorithms in AbortSignal.any(), but that would be more
    complicated and partially limit GC optimizations.

  2. cache: The use of "follow" in cache.addAll was not specced and
    could lead to abort events firing when they shouldn't have. The new
    behavior preserves the specced behavior (aborting outstanding
    requests on failure) without dispatching events when abort is
    triggered internally.

Note: the virtual test expectations match the current expectations
except for the test modified in fetch/api/abort/general.any.js.

[1] whatwg/dom#1152
[2] whatwg/fetch#1646

Bug: 1323391
Low-Coverage-Reason: the uncovered lines in request.cc are covered by WPT tests
Change-Id: I5c25048fcf9f8db759e2f0181ac338c8b603b451
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4515276
Reviewed-by: Nidhi Jaju <nidhijaju@chromium.org>
Reviewed-by: Mason Freed <masonf@chromium.org>
Commit-Queue: Scott Haseley <shaseley@chromium.org>
Reviewed-by: Ben Kelly <wanderview@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1144953}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

AbortSignal's "follow" algorithm is replaced with a new algorithm for
creating a dependent abort signal ([1], [2]), which is implemented as
a new AbortSignal constructor. This CL replaces Follow with the new
ctor, behind the AbortSignalAny REF.

There is a slight compat risk with the change (when the feature ships):
 1. fetch: abort is propagated to dependent signals after abort event
    dispatch for a signal, whereas "follow" propagated abort before (as
    abort algorithms), which is observable. We could alternatively use
    weak abort algorithms in AbortSignal.any(), but that would be more
    complicated and partially limit GC optimizations.

 2. cache: The use of "follow" in cache.addAll was not specced and
    could lead to abort events firing when they shouldn't have. The new
    behavior preserves the specced behavior (aborting outstanding
    requests on failure) without dispatching events when abort is
    triggered internally.

Note: the virtual test expectations match the current expectations
except for the test modified in fetch/api/abort/general.any.js.

[1] whatwg/dom#1152
[2] whatwg/fetch#1646

Bug: 1323391
Low-Coverage-Reason: the uncovered lines in request.cc are covered by WPT tests
Change-Id: I5c25048fcf9f8db759e2f0181ac338c8b603b451
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4515276
Reviewed-by: Nidhi Jaju <nidhijaju@chromium.org>
Reviewed-by: Mason Freed <masonf@chromium.org>
Commit-Queue: Scott Haseley <shaseley@chromium.org>
Reviewed-by: Ben Kelly <wanderview@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1144953}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants