Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-1047

ajp connector not support server sent events

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • 1.2.0.Final
    • AJP
    • None

    Description

      We have a server, running on Wildfly. When we try to establish a new SSE connection to it in chrome, it works fine. In browser I visit http://localhost:18080/retroplanner/events and can see:

      event: open

      Request headers:

      Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
      Accept-Encoding:gzip, deflate, sdch, br
      Accept-Language:ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4
      Cache-Control:max-age=0
      Connection:keep-alive
      Cookie:ZP_CAL=%27fdow%27%3Anull%2C%27history%27%3A%222017/04/17/17/23%2C2017/04/10/17/23%2C2017/04/06/16/48%2C2017/04/03/16/48%22%2C%27sortOrder%27%3A%22asc%22%2C%27hsize%27%3A9; _ga=GA1.1.2135135263.1488966103; JSESSIONID=pNyGbLQEE8wNMkdtzs2bv8GV.sokolov; JSESSIONIDSSO=9JWrzc-UGAzT3ObahJObplwd; __utma=111872281.451747575.1490287052.1491307242.1491399335.6; __utmc=111872281; __utmz=111872281.1490287052.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); DWRSESSIONID=KqK9EKk5yJ3tXo43PAsuEBoV1GOYVZD3YHl
      Host:localhost:18080
      Upgrade-Insecure-Requests:1
      User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

      Response headers:

      Cache-Control:no-cache
      Connection:keep-alive
      Content-Type:text/event-stream;charset=UTF-8
      Date:Wed, 05 Apr 2017 15:01:57 GMT
      Set-Cookie:JSESSIONIDSSO=null; Max-Age=0; Expires=Thu, 01-Jan-1970 00:00:00 GMT
      Transfer-Encoding:chunked

      Apache2 is configured as a proxy server to redirect all requests to Wilfly using ajp connector. Simple functionality (login page, other resources) works fine. So it is configured correctly.

      Now, when I try to establish a SSE connection via Apache server, here is a link: https://sokol.de/retroplanner/events, I do not see any response in chrome.
      I enabled a debug mode in Apache, here is what I have found:

      [Wed Apr 05 17:05:56.287953 2017] [proxy_ajp:debug] [pid 11849:tid 140663631406848] mod_proxy_ajp.c(743): [client 127.0.0.1:54106] AH00895: serving URL ajp://localhost:18009/retroplanner/events
      [Wed Apr 05 17:05:56.287963 2017] [proxy:debug] [pid 11849:tid 140663631406848] proxy_util.c(2160): AH00942: AJP: has acquired connection for (localhost)
      [Wed Apr 05 17:05:56.287968 2017] [proxy:debug] [pid 11849:tid 140663631406848] proxy_util.c(2213): [client 127.0.0.1:54106] AH00944: connecting ajp://localhost:18009/retroplanner/events to localhost:18009
      [Wed Apr 05 17:05:56.288076 2017] [proxy:debug] [pid 11849:tid 140663631406848] proxy_util.c(2422): [client 127.0.0.1:54106] AH00947: connected /retroplanner/events to localhost:18009
      [Wed Apr 05 17:05:56.288141 2017] [proxy:debug] [pid 11849:tid 140663631406848] proxy_util.c(2799): AH02824: AJP: connection established with 127.0.0.1:18009 (localhost)
      [Wed Apr 05 17:05:56.288188 2017] [proxy_ajp:debug] [pid 11849:tid 140663631406848] mod_proxy_ajp.c(269): [client 127.0.0.1:54106] AH00872: APR_BUCKET_IS_EOS
      [Wed Apr 05 17:05:56.288194 2017] [proxy_ajp:debug] [pid 11849:tid 140663631406848] mod_proxy_ajp.c(275): [client 127.0.0.1:54106] AH00873: data to read (max 8186 at 4)
      [Wed Apr 05 17:05:56.288199 2017] [proxy_ajp:debug] [pid 11849:tid 140663631406848] mod_proxy_ajp.c(289): [client 127.0.0.1:54106] AH00875: got 0 bytes of data
      ...
      [Wed Apr 05 17:10:56.390804 2017] [proxy_ajp:error] [pid 11849:tid 140663631406848] (70007)The timeout specified has expired: AH01030: ajp_ilink_receive() can't receive header
      [Wed Apr 05 17:10:56.390857 2017] [proxy_ajp:error] [pid 11849:tid 140663631406848] [client 127.0.0.1:54106] AH00992: ajp_read_header: ajp_ilink_receive failed
      [Wed Apr 05 17:10:56.390864 2017] [proxy_ajp:debug] [pid 11849:tid 140663631406848] mod_proxy_ajp.c(595): (70007)The timeout specified has expired: [client 127.0.0.1:54106] AH00889: ajp_read_header failed
      [Wed Apr 05 17:10:56.390869 2017] [proxy_ajp:debug] [pid 11849:tid 140663631406848] mod_proxy_ajp.c(611): [client 127.0.0.1:54106] AH00890: Processing of request failed backend: 1, client: 0
      [Wed Apr 05 17:10:56.390872 2017] [proxy_ajp:error] [pid 11849:tid 140663631406848] (70007)The timeout specified has expired: [client 127.0.0.1:54106] AH00893: dialog to 127.0.0.1:18009 (localhost) failed
      [Wed Apr 05 17:10:56.390895 2017] [proxy:debug] [pid 11849:tid 140663631406848] proxy_util.c(2175): AH00943: AJP: has released connection for (localhost)
      [Wed Apr 05 17:10:56.391050 2017] [ssl:debug] [pid 11849:tid 140663631406848] ssl_engine_io.c(1016): [client 127.0.0.1:54106] AH02001: Connection closed to child 1 with standard shutdown (server sokol.de:443)

      As soon as I switch to use http connector, everything works fine.
      Here is a wildfly configuration of ajp:

      <ajp-listener name="ajp" socket-binding="ajp" max-post-size="1048576000" tcp-keep-alive="true" read-timeout="600000"/>
      ...
      <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>

      Sorry for formating, how to use this editor is not clear to me. Here is an issue on stackoverflow:
      Server sent events with Apache and Wildfly via ajp connector

      Attachments

        Activity

          People

            sdouglas1@redhat.com Stuart Douglas
            avsokolov_jira Alexandr Sokolov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: