[html5] r7450 - [giow] (3) Change EventSource so that it retries the connection in case of certa [...]

whatwg at whatwg.org whatwg at whatwg.org
Wed Oct 10 16:03:30 PDT 2012


Author: ianh
Date: 2012-10-10 16:03:29 -0700 (Wed, 10 Oct 2012)
New Revision: 7450

Modified:
   complete.html
   index
   source
Log:
[giow] (3) Change EventSource so that it retries the connection in case of certain 5xx errors and in case of DNS errors or failed connections at the TCP level
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=15495
Affected topics: Server-Sent Events

Modified: complete.html
===================================================================
--- complete.html	2012-10-10 22:12:37 UTC (rev 7449)
+++ complete.html	2012-10-10 23:03:29 UTC (rev 7450)
@@ -84260,48 +84260,41 @@
   contents of the stream, the user agent must <a href=#announce-the-connection>announce the
   connection</a>.</p>
 
-  <p>The <a href=#concept-task title=concept-task>task</a> that the
-  <a href=#networking-task-source>networking task source</a> places on the <a href=#task-queue>task
-  queue</a> once the <a href=#fetch title=fetch>fetching algorithm</a>
-  for such a resource (with the correct <a href=#mime-type>MIME type</a>) has
-  completed must cause the user agent to asynchronously
-  <a href=#reestablish-the-connection>reestablish the connection</a>. This applies whether the
-  connection is closed gracefully or unexpectedly. It doesn't apply
-  for the error conditions listed below.</p>
+  <p>The <a href=#concept-task title=concept-task>task</a> that the <a href=#networking-task-source>networking task source</a> places
+  on the <a href=#task-queue>task queue</a> once the <a href=#fetch title=fetch>fetching algorithm</a> for such a
+  resource (with the correct <a href=#mime-type>MIME type</a>) has completed must cause the user agent to
+  asynchronously <a href=#reestablish-the-connection>reestablish the connection</a>. This applies whether the connection is
+  closed gracefully or unexpectedly. It doesn't apply for the error conditions listed below except
+  where explicitly specified.</p>
 
-  <p>HTTP 200 OK responses that have a <a href=#content-type>Content-Type</a>
-  specifying an unsupported type, or that have no
-  <a href=#content-type>Content-Type</a> at all, must cause the user agent to
-  <a href=#fail-the-connection>fail the connection</a>.</p> <!-- about:blank is defined as
-  having no MIME type; javascript: as having the type text/html -->
+  <p>HTTP 200 OK responses that have a <a href=#content-type>Content-Type</a> specifying an unsupported type, or
+  that have no <a href=#content-type>Content-Type</a> at all, must cause the user agent to <a href=#fail-the-connection>fail the
+  connection</a>.</p> <!-- about:blank is defined as having no MIME type; javascript: as having
+  the type text/html -->
 
-  <p>HTTP 305 Use Proxy, 401 Unauthorized, and 407 Proxy
-  Authentication Required should be treated transparently as for any
-  other subresource.</p>
+  <p>HTTP 305 Use Proxy, 401 Unauthorized, and 407 Proxy Authentication Required should be treated
+  transparently as for any other subresource.</p>
 
-  <p>HTTP 301 Moved Permanently, 302 Found, 303 See Other, and
-  307 Temporary Redirect responses are handled by the <a href=#fetch title=fetch>fetching</a> and CORS algorithms. In the case of
-  301 redirects, the user agent must also remember the new URL so that
-  subsequent requests for this resource for this
-  <code><a href=#eventsource>EventSource</a></code> object start with the URL given for the
-  last 301 seen for requests for this object.</p>
+  <p>HTTP 301 Moved Permanently, 302 Found, 303 See Other, and 307 Temporary Redirect responses are
+  handled by the <a href=#fetch title=fetch>fetching</a> and CORS algorithms. In the case of 301
+  redirects, the user agent must also remember the new URL so that subsequent requests for this
+  resource for this <code><a href=#eventsource>EventSource</a></code> object start with the URL given for the last 301 seen
+  for requests for this object.</p>
 
-  <p>Any other HTTP response code not listed here, and any network
-  error that prevents the HTTP connection from being established in
-  the first place (e.g. DNS errors), must cause the user agent to
-  <a href=#fail-the-connection>fail the connection</a>.</p> <!-- including: HTTP 201
-  Created, 202 Accepted, 203 Non-Authoritative Information, 204 No
-  Content, 205 Reset Content, 206 Partial Content, 300 Multiple
-  Choices, 304 Not Modified, 400 Bad Request, 403 Forbidden, 404 Not
-  Found, 405 Method Not Allowed, 406 Not Acceptable, 408 Request
-  Timeout, 409 Conflict, 410 Gone, 411 Length Required, 412
-  Precondition Failed, 413 Request Entity Too Large, 414 Request-URI
-  Too Long, 415 Unsupported Media Type, 416 Requested Range Not
-  Satisfiable, 417 Expectation Failed, 500 Internal Server Error, 501
-  Not Implemented, 502 Bad Gateway, 503 Service Unavailable, 504
-  Gateway Timeout, and 505 HTTP Version Not Supported responses -->
-  <!-- mailto: is defined as equivalent to HTTP 204 -->
+  <p>HTTP 500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable, and 504 Gateway
+  Timeout responses, and any network error that prevents the connection from being established in
+  the first place (e.g. DNS errors), must cause the user agent to asynchronously <a href=#reestablish-the-connection>reestablish
+  the connection</a>.</p>
 
+  <p>Any other HTTP response code not listed here must cause the user agent to <a href=#fail-the-connection>fail the
+  connection</a>.</p> <!-- including: HTTP 201 Created, 202 Accepted, 203 Non-Authoritative
+  Information, 204 No Content, 205 Reset Content, 206 Partial Content, 300 Multiple Choices, 304 Not
+  Modified, 400 Bad Request, 403 Forbidden, 404 Not Found, 405 Method Not Allowed, 406 Not
+  Acceptable, 408 Request Timeout, 409 Conflict, 410 Gone, 411 Length Required, 412 Precondition
+  Failed, 413 Request Entity Too Large, 414 Request-URI Too Long, 415 Unsupported Media Type, 416
+  Requested Range Not Satisfiable, 417 Expectation Failed, 501 Not Implemented, and 505 HTTP Version
+  Not Supported responses --> <!-- mailto: is defined as equivalent to HTTP 204 -->
+
   <p>For non-HTTP protocols, UAs should act in equivalent ways.</p>
 
   <hr><p>When a user agent is to <dfn id=announce-the-connection>announce the connection</dfn>, the
@@ -84335,6 +84328,12 @@
    <li><p>Wait a delay equal to the reconnection time of the event
    source.</li>
 
+   <li><p>Optionally, wait some more. In particular, if the previous attempt failed, then user
+   agents might introduce an exponential backoff delay to avoid overloading a potentially already
+   overloaded server. Alternatively, if the operating system has reported that there is no network
+   connectivity, user agents might wait for the operating system to announce that the network
+   connection has returned before retrying.</li>
+
    <li><p>Wait until the aforementioned task has run, if it has not
    yet run.</li>
 

Modified: index
===================================================================
--- index	2012-10-10 22:12:37 UTC (rev 7449)
+++ index	2012-10-10 23:03:29 UTC (rev 7450)
@@ -84260,48 +84260,41 @@
   contents of the stream, the user agent must <a href=#announce-the-connection>announce the
   connection</a>.</p>
 
-  <p>The <a href=#concept-task title=concept-task>task</a> that the
-  <a href=#networking-task-source>networking task source</a> places on the <a href=#task-queue>task
-  queue</a> once the <a href=#fetch title=fetch>fetching algorithm</a>
-  for such a resource (with the correct <a href=#mime-type>MIME type</a>) has
-  completed must cause the user agent to asynchronously
-  <a href=#reestablish-the-connection>reestablish the connection</a>. This applies whether the
-  connection is closed gracefully or unexpectedly. It doesn't apply
-  for the error conditions listed below.</p>
+  <p>The <a href=#concept-task title=concept-task>task</a> that the <a href=#networking-task-source>networking task source</a> places
+  on the <a href=#task-queue>task queue</a> once the <a href=#fetch title=fetch>fetching algorithm</a> for such a
+  resource (with the correct <a href=#mime-type>MIME type</a>) has completed must cause the user agent to
+  asynchronously <a href=#reestablish-the-connection>reestablish the connection</a>. This applies whether the connection is
+  closed gracefully or unexpectedly. It doesn't apply for the error conditions listed below except
+  where explicitly specified.</p>
 
-  <p>HTTP 200 OK responses that have a <a href=#content-type>Content-Type</a>
-  specifying an unsupported type, or that have no
-  <a href=#content-type>Content-Type</a> at all, must cause the user agent to
-  <a href=#fail-the-connection>fail the connection</a>.</p> <!-- about:blank is defined as
-  having no MIME type; javascript: as having the type text/html -->
+  <p>HTTP 200 OK responses that have a <a href=#content-type>Content-Type</a> specifying an unsupported type, or
+  that have no <a href=#content-type>Content-Type</a> at all, must cause the user agent to <a href=#fail-the-connection>fail the
+  connection</a>.</p> <!-- about:blank is defined as having no MIME type; javascript: as having
+  the type text/html -->
 
-  <p>HTTP 305 Use Proxy, 401 Unauthorized, and 407 Proxy
-  Authentication Required should be treated transparently as for any
-  other subresource.</p>
+  <p>HTTP 305 Use Proxy, 401 Unauthorized, and 407 Proxy Authentication Required should be treated
+  transparently as for any other subresource.</p>
 
-  <p>HTTP 301 Moved Permanently, 302 Found, 303 See Other, and
-  307 Temporary Redirect responses are handled by the <a href=#fetch title=fetch>fetching</a> and CORS algorithms. In the case of
-  301 redirects, the user agent must also remember the new URL so that
-  subsequent requests for this resource for this
-  <code><a href=#eventsource>EventSource</a></code> object start with the URL given for the
-  last 301 seen for requests for this object.</p>
+  <p>HTTP 301 Moved Permanently, 302 Found, 303 See Other, and 307 Temporary Redirect responses are
+  handled by the <a href=#fetch title=fetch>fetching</a> and CORS algorithms. In the case of 301
+  redirects, the user agent must also remember the new URL so that subsequent requests for this
+  resource for this <code><a href=#eventsource>EventSource</a></code> object start with the URL given for the last 301 seen
+  for requests for this object.</p>
 
-  <p>Any other HTTP response code not listed here, and any network
-  error that prevents the HTTP connection from being established in
-  the first place (e.g. DNS errors), must cause the user agent to
-  <a href=#fail-the-connection>fail the connection</a>.</p> <!-- including: HTTP 201
-  Created, 202 Accepted, 203 Non-Authoritative Information, 204 No
-  Content, 205 Reset Content, 206 Partial Content, 300 Multiple
-  Choices, 304 Not Modified, 400 Bad Request, 403 Forbidden, 404 Not
-  Found, 405 Method Not Allowed, 406 Not Acceptable, 408 Request
-  Timeout, 409 Conflict, 410 Gone, 411 Length Required, 412
-  Precondition Failed, 413 Request Entity Too Large, 414 Request-URI
-  Too Long, 415 Unsupported Media Type, 416 Requested Range Not
-  Satisfiable, 417 Expectation Failed, 500 Internal Server Error, 501
-  Not Implemented, 502 Bad Gateway, 503 Service Unavailable, 504
-  Gateway Timeout, and 505 HTTP Version Not Supported responses -->
-  <!-- mailto: is defined as equivalent to HTTP 204 -->
+  <p>HTTP 500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable, and 504 Gateway
+  Timeout responses, and any network error that prevents the connection from being established in
+  the first place (e.g. DNS errors), must cause the user agent to asynchronously <a href=#reestablish-the-connection>reestablish
+  the connection</a>.</p>
 
+  <p>Any other HTTP response code not listed here must cause the user agent to <a href=#fail-the-connection>fail the
+  connection</a>.</p> <!-- including: HTTP 201 Created, 202 Accepted, 203 Non-Authoritative
+  Information, 204 No Content, 205 Reset Content, 206 Partial Content, 300 Multiple Choices, 304 Not
+  Modified, 400 Bad Request, 403 Forbidden, 404 Not Found, 405 Method Not Allowed, 406 Not
+  Acceptable, 408 Request Timeout, 409 Conflict, 410 Gone, 411 Length Required, 412 Precondition
+  Failed, 413 Request Entity Too Large, 414 Request-URI Too Long, 415 Unsupported Media Type, 416
+  Requested Range Not Satisfiable, 417 Expectation Failed, 501 Not Implemented, and 505 HTTP Version
+  Not Supported responses --> <!-- mailto: is defined as equivalent to HTTP 204 -->
+
   <p>For non-HTTP protocols, UAs should act in equivalent ways.</p>
 
   <hr><p>When a user agent is to <dfn id=announce-the-connection>announce the connection</dfn>, the
@@ -84335,6 +84328,12 @@
    <li><p>Wait a delay equal to the reconnection time of the event
    source.</li>
 
+   <li><p>Optionally, wait some more. In particular, if the previous attempt failed, then user
+   agents might introduce an exponential backoff delay to avoid overloading a potentially already
+   overloaded server. Alternatively, if the operating system has reported that there is no network
+   connectivity, user agents might wait for the operating system to announce that the network
+   connection has returned before retrying.</li>
+
    <li><p>Wait until the aforementioned task has run, if it has not
    yet run.</li>
 

Modified: source
===================================================================
--- source	2012-10-10 22:12:37 UTC (rev 7449)
+++ source	2012-10-10 23:03:29 UTC (rev 7450)
@@ -97891,49 +97891,41 @@
   contents of the stream, the user agent must <span>announce the
   connection</span>.</p>
 
-  <p>The <span title="concept-task">task</span> that the
-  <span>networking task source</span> places on the <span>task
-  queue</span> once the <span title="fetch">fetching algorithm</span>
-  for such a resource (with the correct <span>MIME type</span>) has
-  completed must cause the user agent to asynchronously
-  <span>reestablish the connection</span>. This applies whether the
-  connection is closed gracefully or unexpectedly. It doesn't apply
-  for the error conditions listed below.</p>
+  <p>The <span title="concept-task">task</span> that the <span>networking task source</span> places
+  on the <span>task queue</span> once the <span title="fetch">fetching algorithm</span> for such a
+  resource (with the correct <span>MIME type</span>) has completed must cause the user agent to
+  asynchronously <span>reestablish the connection</span>. This applies whether the connection is
+  closed gracefully or unexpectedly. It doesn't apply for the error conditions listed below except
+  where explicitly specified.</p>
 
-  <p>HTTP 200 OK responses that have a <span>Content-Type</span>
-  specifying an unsupported type, or that have no
-  <span>Content-Type</span> at all, must cause the user agent to
-  <span>fail the connection</span>.</p> <!-- about:blank is defined as
-  having no MIME type; javascript: as having the type text/html -->
+  <p>HTTP 200 OK responses that have a <span>Content-Type</span> specifying an unsupported type, or
+  that have no <span>Content-Type</span> at all, must cause the user agent to <span>fail the
+  connection</span>.</p> <!-- about:blank is defined as having no MIME type; javascript: as having
+  the type text/html -->
 
-  <p>HTTP 305 Use Proxy, 401 Unauthorized, and 407 Proxy
-  Authentication Required should be treated transparently as for any
-  other subresource.</p>
+  <p>HTTP 305 Use Proxy, 401 Unauthorized, and 407 Proxy Authentication Required should be treated
+  transparently as for any other subresource.</p>
 
-  <p>HTTP 301 Moved Permanently, 302 Found, 303 See Other, and
-  307 Temporary Redirect responses are handled by the <span
-  title="fetch">fetching</span> and CORS algorithms. In the case of
-  301 redirects, the user agent must also remember the new URL so that
-  subsequent requests for this resource for this
-  <code>EventSource</code> object start with the URL given for the
-  last 301 seen for requests for this object.</p>
+  <p>HTTP 301 Moved Permanently, 302 Found, 303 See Other, and 307 Temporary Redirect responses are
+  handled by the <span title="fetch">fetching</span> and CORS algorithms. In the case of 301
+  redirects, the user agent must also remember the new URL so that subsequent requests for this
+  resource for this <code>EventSource</code> object start with the URL given for the last 301 seen
+  for requests for this object.</p>
 
-  <p>Any other HTTP response code not listed here, and any network
-  error that prevents the HTTP connection from being established in
-  the first place (e.g. DNS errors), must cause the user agent to
-  <span>fail the connection</span>.</p> <!-- including: HTTP 201
-  Created, 202 Accepted, 203 Non-Authoritative Information, 204 No
-  Content, 205 Reset Content, 206 Partial Content, 300 Multiple
-  Choices, 304 Not Modified, 400 Bad Request, 403 Forbidden, 404 Not
-  Found, 405 Method Not Allowed, 406 Not Acceptable, 408 Request
-  Timeout, 409 Conflict, 410 Gone, 411 Length Required, 412
-  Precondition Failed, 413 Request Entity Too Large, 414 Request-URI
-  Too Long, 415 Unsupported Media Type, 416 Requested Range Not
-  Satisfiable, 417 Expectation Failed, 500 Internal Server Error, 501
-  Not Implemented, 502 Bad Gateway, 503 Service Unavailable, 504
-  Gateway Timeout, and 505 HTTP Version Not Supported responses -->
-  <!-- mailto: is defined as equivalent to HTTP 204 -->
+  <p>HTTP 500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable, and 504 Gateway
+  Timeout responses, and any network error that prevents the connection from being established in
+  the first place (e.g. DNS errors), must cause the user agent to asynchronously <span>reestablish
+  the connection</span>.</p>
 
+  <p>Any other HTTP response code not listed here must cause the user agent to <span>fail the
+  connection</span>.</p> <!-- including: HTTP 201 Created, 202 Accepted, 203 Non-Authoritative
+  Information, 204 No Content, 205 Reset Content, 206 Partial Content, 300 Multiple Choices, 304 Not
+  Modified, 400 Bad Request, 403 Forbidden, 404 Not Found, 405 Method Not Allowed, 406 Not
+  Acceptable, 408 Request Timeout, 409 Conflict, 410 Gone, 411 Length Required, 412 Precondition
+  Failed, 413 Request Entity Too Large, 414 Request-URI Too Long, 415 Unsupported Media Type, 416
+  Requested Range Not Satisfiable, 417 Expectation Failed, 501 Not Implemented, and 505 HTTP Version
+  Not Supported responses --> <!-- mailto: is defined as equivalent to HTTP 204 -->
+
   <p>For non-HTTP protocols, UAs should act in equivalent ways.</p>
 
   <hr>
@@ -97984,6 +97976,12 @@
    <li><p>Wait a delay equal to the reconnection time of the event
    source.</li>
 
+   <li><p>Optionally, wait some more. In particular, if the previous attempt failed, then user
+   agents might introduce an exponential backoff delay to avoid overloading a potentially already
+   overloaded server. Alternatively, if the operating system has reported that there is no network
+   connectivity, user agents might wait for the operating system to announce that the network
+   connection has returned before retrying.</li>
+
    <li><p>Wait until the aforementioned task has run, if it has not
    yet run.</p></li>
 




More information about the Commit-Watchers mailing list