<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>28823</bug_id>
          
          <creation_ts>2015-06-17 05:07:55 +0000</creation_ts>
          <short_desc>Course of action even after Event Source retry failure.</short_desc>
          <delta_ts>2015-10-05 10:37:14 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>HISTORICAL - Server-Sent Events (editor: Ian Hickson)</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Prashant Hiremath">hiremathprashants</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>121171</commentid>
    <comment_count>0</comment_count>
    <who name="Prashant Hiremath">hiremathprashants</who>
    <bug_when>2015-06-17 05:07:55 +0000</bug_when>
    <thetext>As per the spec https://html.spec.whatwg.org/multipage/comms.html#processing-model-10 , when EventSource fail to establish the connection first time,
it should retry to connect to given URL after time specified in the &quot;retry&quot; field/UA default value. But Spec doesn&apos;t tell specifically what should be
done if retry attempt fails.

And since this &quot;retry&quot; field is in seconds, Browser should try only once or is it retry interval(i.e browser should keep on retrying after every retry seconds).

For eg:
var evtSource = new EventSource(&quot;http://www.test.not&quot;)
evtSource.onerror = function() {
   console.log(evtSource.readyState);
}

In above case Browsers behavior is :

Firefox retries only once and if it fails to establish the connection to given URL it closes the connection.

But Blinks keep on retrying for given URL with readyState set to CONNECTING.

Can spec be more specific on this i.e what should be done if it fails to connect even after retry?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121182</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-06-17 06:24:22 +0000</bug_when>
    <thetext>&quot;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.&quot; is pretty clear, no?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121200</commentid>
    <comment_count>2</comment_count>
    <who name="Prashant Hiremath">hiremathprashants</who>
    <bug_when>2015-06-17 15:36:15 +0000</bug_when>
    <thetext>(In reply to Anne from comment #1)
&gt; &quot;Optionally, wait some more. In particular, if the previous attempt failed,
&gt; then user agents might introduce an exponential backoff delay to avoid
&gt; overloading a potentially already overloaded server. Alternatively, if the
&gt; operating system has reported that there is no network connectivity, user
&gt; agents might wait for the operating system to announce that the network
&gt; connection has returned before retrying.&quot; is pretty clear, no?

Hi Anne, thanks for the reply.
Please correct my understanding -

In the example what I have mentioned it is particularly about DNS resolution failure. As per the spec &quot;Network errors that prevents the connection from being established in the first place (e.g. DNS errors), must cause the user agent to reestablish the connection in parallel.&quot;

And Now we will try to reestablish the connection and spec says &quot;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.&quot;

But this is a case of &quot;Name Resolution failure&quot;, not about N/W connectivity problem as given URL(http://www.test.not) itself is invalid even though N/W connection exists. So my bug report was particular about this kind of scenarios, where N/W connectivity exists but reason for retry may be other N/W related errors, how to handle this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121202</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-06-17 15:58:58 +0000</bug_when>
    <thetext>That set of steps is invoked from &quot;Network errors that prevents the connection from being established in the first place (e.g. DNS errors), must cause the user agent to reestablish the connection in parallel.&quot; though. But yeah, the specification should probably be updated to allow disconnecting somewhere there as well in clear cut scenarios.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123479</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-10-05 10:37:14 +0000</bug_when>
    <thetext>https://github.com/whatwg/html/pull/226</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>