New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 52 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 20
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocked on:
issue 817687

Blocking:
issue 803833
issue 808732



Sign in to add a comment

Implement AbortController, AbortSignal, abortable fetch

Project Member Reported by jakearchibald@chromium.org, Jul 31 2017

Issue description

https://dom.spec.whatwg.org/#aborting-ongoing-activities

Fetch abort tests are at https://github.com/w3c/web-platform-tests/pull/6484.

Fetch abort spec is in progress https://github.com/whatwg/fetch/pull/523.

Mozilla intends to start implementing next month, using the tests rather than the spec.
 
Cc: ricea@chromium.org
Labels: -Pri-3 Pri-2
Status: Available (was: Untriaged)
Great that we're closer to fetch() + cancellation!

+ricea@ tentatively

Comment 2 by engedy@chromium.org, Aug 22 2017

Cc: engedy@chromium.org
Cc: kpaulhamus@chromium.org

Comment 6 by ricea@chromium.org, Dec 8 2017

Owner: ricea@chromium.org
Status: Assigned (was: Available)
Blocking: 803833
Blocking: 161072
Blocking: 808732
Project Member

Comment 10 by bugdroid1@chromium.org, Feb 5

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3ea192285757861d168b6e508bb34bc054194a22

commit 3ea192285757861d168b6e508bb34bc054194a22
Author: Adam Rice <ricea@chromium.org>
Date: Mon Feb 05 09:08:10 2018

Implement AbortController and AbortSignal

Also adjust layout tests expectations to match the new behaviour. One
fetch() wpt test that previously failed due to AbortController being
undefined now times out because the "signal" properties in fetch options
doesn't do anything yet. This will be fixed once it is implemented.

Spec: https://dom.spec.whatwg.org/#aborting-ongoing-activities
Design doc: https://docs.google.com/document/d/1OuoCG2uiijbAwbCw9jaS7tHEO0LBO_4gMNio1ox0qlY/edit
Intent to Ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/9vNZh4fhV2U/ZVxD2iQACgAJ

BUG= 750599 

Change-Id: I0e504bbf7f8552d602913ee2069bbf90f95deaff
Reviewed-on: https://chromium-review.googlesource.com/896669
Commit-Queue: Adam Rice <ricea@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Hayato Ito <hayato@chromium.org>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534352}
[modify] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/LayoutTests/TestExpectations
[delete] https://crrev.com/406010c4b4e27073d52f2d7af881a302d1beae99/third_party/WebKit/LayoutTests/external/wpt/dom/abort/event.any-expected.txt
[modify] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/LayoutTests/external/wpt/dom/abort/event.any.js
[delete] https://crrev.com/406010c4b4e27073d52f2d7af881a302d1beae99/third_party/WebKit/LayoutTests/external/wpt/dom/abort/event.any.worker-expected.txt
[delete] https://crrev.com/406010c4b4e27073d52f2d7af881a302d1beae99/third_party/WebKit/LayoutTests/external/wpt/dom/interface-objects-expected.txt
[delete] https://crrev.com/406010c4b4e27073d52f2d7af881a302d1beae99/third_party/WebKit/LayoutTests/external/wpt/dom/interfaces-expected.txt
[modify] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/LayoutTests/external/wpt/dom/interfaces.html
[modify] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/LayoutTests/external/wpt/fetch/api/abort/cache.https-expected.txt
[modify] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/LayoutTests/external/wpt/fetch/api/abort/serviceworker-intercepted.https-expected.txt
[modify] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[delete] https://crrev.com/406010c4b4e27073d52f2d7af881a302d1beae99/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[modify] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[modify] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt
[modify] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt
[modify] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
[modify] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
[modify] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/Source/core/core_idl_files.gni
[add] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/Source/core/dom/AbortController.cpp
[add] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/Source/core/dom/AbortController.h
[add] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/Source/core/dom/AbortController.idl
[add] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/Source/core/dom/AbortSignal.cpp
[add] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/Source/core/dom/AbortSignal.h
[add] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/Source/core/dom/AbortSignal.idl
[modify] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/Source/core/dom/BUILD.gn
[modify] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/Source/core/events/event_target_names.json5
[modify] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/third_party/WebKit/public/platform/web_feature.mojom
[modify] https://crrev.com/3ea192285757861d168b6e508bb34bc054194a22/tools/metrics/histograms/enums.xml

Blocking: -161072
Blockedon: 817687
Project Member

Comment 13 by bugdroid1@chromium.org, Mar 1

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c

commit c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c
Author: Adam Rice <ricea@chromium.org>
Date: Thu Mar 01 07:49:17 2018

Implement fetch() abort

- Add an optional |signal| property to RequestInit
- Add a |signal| property to Request, chained from RequestInit's signal
- Create a chained AbortSignal in Request clone()
- Add an Abort() method to FetchManager::Loader
- Add an AbortSignal parameter to FetchManager::Fetch()
- Add an AbortSignal member to FetchManager::Loader and BodyStreamBuffer

The implementation closely follows the Fetch standard, particularly the
initialisationn of |signal| in the Request constructor:
https://fetch.spec.whatwg.org/#request-class and the signal-related
steps in the fetch method: https://fetch.spec.whatwg.org/#fetch-method.

The AbortSignal member of BodyStreamBuffer is only set for Response
objects. It is not meaningful for Request objects. In addition, it is
not set when a Response is created from a stream, as there is no
associated Request that JS code could use to abort the response.

The design doc is at
https://docs.google.com/document/d/1OuoCG2uiijbAwbCw9jaS7tHEO0LBO_4gMNio1ox0qlY/edit.

The Intent to Ship thread is at
https://groups.google.com/a/chromium.org/d/msg/blink-dev/9vNZh4fhV2U/ZVxD2iQACgAJ.

Known issues: when abort is signaled between a body access method like
arrayBuffer() being called and the returned promise resolving, the
promise will reject with a TypeError rather than an AbortError.
See  http://crbug.com/817687 .

BUG= 750599 

Change-Id: I19dfb311f55fcdc566b07449ef2c61ef7be301c7
Reviewed-on: https://chromium-review.googlesource.com/934542
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540095}
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/LayoutTests/TestExpectations
[delete] https://crrev.com/e091bb4fe9e5c1919c5f1a88b6e2a1bc9a27a19f/third_party/WebKit/LayoutTests/external/wpt/fetch/api/abort/cache.https-expected.txt
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/LayoutTests/external/wpt/fetch/api/abort/general-serviceworker.https-expected.txt
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/LayoutTests/external/wpt/fetch/api/abort/general-sharedworker-expected.txt
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/LayoutTests/external/wpt/fetch/api/abort/general.any-expected.txt
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/LayoutTests/external/wpt/fetch/api/abort/general.any.worker-expected.txt
[delete] https://crrev.com/e091bb4fe9e5c1919c5f1a88b6e2a1bc9a27a19f/third_party/WebKit/LayoutTests/external/wpt/fetch/api/abort/serviceworker-intercepted.https-expected.txt
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/request.js
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/Source/core/fetch/Body.cpp
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/Source/core/fetch/BodyStreamBuffer.cpp
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/Source/core/fetch/BodyStreamBuffer.h
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/Source/core/fetch/BodyStreamBufferTest.cpp
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/Source/core/fetch/FetchManager.cpp
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/Source/core/fetch/FetchManager.h
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/Source/core/fetch/FetchRequestData.cpp
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/Source/core/fetch/GlobalFetch.cpp
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/Source/core/fetch/Request.cpp
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/Source/core/fetch/Request.h
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/Source/core/fetch/Request.idl
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/Source/core/fetch/RequestInit.cpp
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/Source/core/fetch/RequestInit.h
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/Source/core/fetch/Response.cpp
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/Source/core/fetch/ResponseTest.cpp
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/Source/modules/cachestorage/CacheTest.cpp
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.cpp
[modify] https://crrev.com/c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c/third_party/WebKit/Source/platform/runtime_enabled_features.json5

Project Member

Comment 14 by bugdroid1@chromium.org, Mar 6

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c2520b4e95cc4bfaaeae4ed8c85aca613785405c

commit c2520b4e95cc4bfaaeae4ed8c85aca613785405c
Author: Adam Rice <ricea@chromium.org>
Date: Tue Mar 06 11:19:03 2018

Add the "follow" algorithm to AbortSignal

Add a Follow() method to AbortSignal that implements this algorithm:
https://dom.spec.whatwg.org/#abortsignal-follow.

Update the Request constructor and clone() method to use the algorithm.

Add a layout test that chains of AbortSignals don't drop aborts when garbage
collection happens.

Bug:  750599 
Change-Id: Id4e0df8b81aae3037e324d7787b5ba604ab9efba
Reviewed-on: https://chromium-review.googlesource.com/948384
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Hayato Ito <hayato@chromium.org>
Commit-Queue: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541070}
[add] https://crrev.com/c2520b4e95cc4bfaaeae4ed8c85aca613785405c/third_party/WebKit/LayoutTests/http/tests/fetch/chromium/signal-gc.html
[modify] https://crrev.com/c2520b4e95cc4bfaaeae4ed8c85aca613785405c/third_party/WebKit/Source/core/dom/AbortSignal.cpp
[modify] https://crrev.com/c2520b4e95cc4bfaaeae4ed8c85aca613785405c/third_party/WebKit/Source/core/dom/AbortSignal.h
[modify] https://crrev.com/c2520b4e95cc4bfaaeae4ed8c85aca613785405c/third_party/WebKit/Source/core/fetch/Request.cpp

Status: Fixed (was: Assigned)
This is done. M66 has abort but the rejections may be TypeErrors rather than AbortErrors. M67 has the fixed semantics.

There are a couple of ServiceWorker-related issues to follow up: the big one is issue 823697, "fetch() abort in page should be reflected in Request in service worker".

There's also the question of what the page should see when abort is used inside the service worker.

Sign in to add a comment