Jetty
  1. Jetty
  2. JETTY-322

AJP13 - Invalid state on AJP CPING request

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      4

      Description

      I'm using Linux ubuntu with Apache 2.0.55 and mod_jk 1.2.14. (I tried it on redhat 4 also with apache 2.0.52 and mod_jk 1.2.19 it is the same).
      With the latest version of jetty (6.1.2rc5) I managed to solve most of my problems with Ajp13 (SSL and other).
      With basic configuration the HTTP and HTTPS queries are answered but some strange error appears in the mod_jk.log file.
      The mod_jk.log is full of:
      [Thu Apr 26 23:17:38 2007] [info] ajp_send_request::jk_ajp_common.c (1178): Socket 14 is not connected any more (errno=-1)
      [Thu Apr 26 23:17:38 2007] [info] ajp_send_request::jk_ajp_common.c (1202): Error sending request. Will try another pooled connection
      [Thu Apr 26 23:17:38 2007] [info] ajp_send_request::jk_ajp_common.c (1225): All endpoints are disconnected or dead
      [Thu Apr 26 23:17:38 2007] [info] ajp_service::jk_ajp_common.c (1749): Sending request to tomcat failed, recoverable operation attempt=1
      [Thu Apr 26 23:17:39 2007] [info] ajp_send_request::jk_ajp_common.c (1178): Socket 14 is not connected any more (errno=-1)
      [Thu Apr 26 23:17:39 2007] [info] ajp_send_request::jk_ajp_common.c (1202): Error sending request. Will try another pooled connection

      Suspecting connections not keep alive I changed my worker.properties with:
      worker.list=jetty
      worker.jetty.port=8011
      worker.jetty.host=localhost
      worker.jetty.type=ajp13
      worker.jetty.lbfactor=1
      worker.jetty.socket_keepalive=1
      worker.jetty.socket_timeout=60
      worker.jetty.recycle_timeout=60
      worker.jetty.connect_timeout=60000
      worker.jetty.prepost_timeout=60000

      Now I get on jetty:
      2007-04-26 23:43:18.934::WARN: handle failed
      java.lang.IllegalStateException: State==HEADER
      at org.mortbay.jetty.ajp.Ajp13Generator.flush(Ajp13Generator.java:431)
      at org.mortbay.jetty.ajp.Ajp13Generator.sendCPong(Ajp13Generator.java:765)
      at org.mortbay.jetty.ajp.Ajp13Parser.parseNext(Ajp13Parser.java:294)
      at org.mortbay.jetty.ajp.Ajp13Parser.parseAvailable(Ajp13Parser.java:142)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java :378)
      at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:226)
      at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
      2007-04-26 23:43:18.937::INFO: AJP13: CPING is sent by peer

      and on mod_jk.log:
      [Thu Apr 26 23:37:31 2007] [info] ajp_connection_tcp_get_message::jk_ajp_common.c (955): Tomcat has forced a connection close for socket 14
      [Thu Apr 26 23:37:31 2007] [info] ajp_handle_cping_cpong::jk_ajp_common.c (833): awaited reply cpong, not received
      [Thu Apr 26 23:37:31 2007] [info] ajp_send_request::jk_ajp_common.c (1248): Error connecting to the Tomcat process.
      [Thu Apr 26 23:37:31 2007] [info] ajp_service::jk_ajp_common.c (1749): Sending request to tomcat failed, recoverable operation attempt=3
      [Thu Apr 26 23:37:31 2007] [error] ajp_service::jk_ajp_common.c (1758): Error connecting to tomcat. Tomcat is probably not started or is listening on the wrong port. worker=jetty failed
      [Thu Apr 26 23:37:31 2007] [info] jk_handler::mod_jk.c (1971): Service error=0 for worker=jetty

      1. ajp_patch_20070423.patch
        1 kB
        Leopoldo Agdeppa III
      2. ajp_patch_20070430.patch
        2 kB
        Leopoldo Agdeppa III
      3. ajp_patch_20070503.patch
        9 kB
        Leopoldo Agdeppa III
      4. fred_ajp_patch_20070429.patch
        4 kB
        Frederic Simon

        Activity

        Hide
        Frederic Simon added a comment -

        OK.
        But anyway AJP is really a persistent connections protocol so setting the genrator to persistent looks mandatory to me, no?

        Show
        Frederic Simon added a comment - OK. But anyway AJP is really a persistent connections protocol so setting the genrator to persistent looks mandatory to me, no?
        Hide
        Greg Wilkins added a comment -

        I have applied the additional patches and done a few tidy ups.
        AJP is working for me for both apache 2.2 and apache 2.0, with mod_jk and mod_proxy_jk.
        However, I don't think I observed any CPINGs at all from them. Under what circumstances
        are CPINGs generated?

        Can this patch be tested as a matter of urgency as it is the blocker on a stable 6.1.2 release.

        cheers

        Show
        Greg Wilkins added a comment - I have applied the additional patches and done a few tidy ups. AJP is working for me for both apache 2.2 and apache 2.0, with mod_jk and mod_proxy_jk. However, I don't think I observed any CPINGs at all from them. Under what circumstances are CPINGs generated? Can this patch be tested as a matter of urgency as it is the blocker on a stable 6.1.2 release. cheers
        Hide
        Frederic Simon added a comment -

        Great.
        The CPING/CPONG appears when the following params are added to mod_jk 1.2.xx:
        worker.jetty.socket_keepalive=1
        worker.jetty.socket_timeout=60
        worker.jetty.recycle_timeout=60
        worker.jetty.connect_timeout=60000
        worker.jetty.prepost_timeout=60000

        Show
        Frederic Simon added a comment - Great. The CPING/CPONG appears when the following params are added to mod_jk 1.2.xx: worker.jetty.socket_keepalive=1 worker.jetty.socket_timeout=60 worker.jetty.recycle_timeout=60 worker.jetty.connect_timeout=60000 worker.jetty.prepost_timeout=60000
        Hide
        Leopoldo Agdeppa III added a comment -

        this time its really fixed

        Show
        Leopoldo Agdeppa III added a comment - this time its really fixed
        Hide
        Leopoldo Agdeppa III added a comment -

        fixed

        Show
        Leopoldo Agdeppa III added a comment - fixed

          People

          • Assignee:
            Leopoldo Agdeppa III
            Reporter:
            Leopoldo Agdeppa III
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: