Bug 27884 - mod_jk2 making multiple requests when client cancels the load of the page
Summary: mod_jk2 making multiple requests when client cancels the load of the page
Status: RESOLVED WONTFIX
Alias: None
Product: Tomcat Connectors
Classification: Unclassified
Component: Common (show other bugs)
Version: unspecified
Hardware: PC All
: P3 major (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-24 00:05 UTC by Biju Kunjummen
Modified: 2008-10-05 03:13 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Biju Kunjummen 2004-03-24 00:05:17 UTC
Mod_jk2 connector seems to make an extra request when the client cuts of the 
connection. Eg. If a page takes too much time to load and if the user cancels 
the load of the page/clicks to go to another page, then mod_jk2 continues with 
the first request but makes a duplicate first request again.

Say if a page has two links 
Link1 linking to Page1 
and Link2 linking to page2, if a user clicks on link1 and before page1 loads 
clicks on link2, then mod_jk2 seems to make 2 requests to page1(which is very 
wrong) and 1 request to page2(which is correct)

The behaviour is correct with mod_jk however.


Configuration: IIS 5.0, mod_jk2, Jakarta Tomcat 4.1.23
Comment 1 Henri Gomez 2004-03-24 08:48:08 UTC
Which version of jk2 ?

Take a look at the latest in CVS which will be tagged 2.0.4 today
Comment 2 Biju Kunjummen 2004-03-24 14:19:19 UTC
I am using the release version 2.0.2 right now. Is there a binary version of 
2.04 that I can download from someplace. I can test out if this fixes this 
issue. From what I have seen of the 2.0.2 code, I felt that the following line 
has an issue:

jk_worker_ajp13.c:

#define JK_RETRIES 2


static int JK_METHOD
jk2_worker_ajp13_forwardStream(jk_env_t *env, jk_worker_t *worker,
                              jk_ws_service_t *s,
                              jk_endpoint_t   *e )
{
    int err=JK_OK;
    int attempt;
    int has_post_body=JK_FALSE;
    jk_channel_t *channel= worker->channel;

    e->recoverable = JK_TRUE;
    s->is_recoverable_error = JK_TRUE;

    /*
     * Try to send the request on a valid endpoint. If one endpoint
     * fails, close the channel and try again ( maybe tomcat was restarted )
     *
     * XXX JK_RETRIES could be replaced by the number of workers in
     * a load-balancing configuration
     */
    for(attempt = 0 ; attempt < JK_RETRIES ;attempt++) {



Comment 3 Henri Gomez 2004-03-24 14:26:48 UTC
Thanks to check against latest JK 2.0.4 (tagged today), tarball in few hours 
and reopen if needed
Comment 4 Biju Kunjummen 2004-03-26 22:58:54 UTC
Henri, 
I tried with version 2.0.4 and it too has the exact same bug. Essentially when 
I don't allow a page to load(by escaping the load, or by clicking on another 
link) mod_jk2 tends to make a duplicate request to the tomcat engine.
This could be because of my configuration, that is why I am including the 
relevant configuration entries too here:

worker2.properties:

[shm]
file=E:/pr/logs/jk2.shm
size=1048576

[channel.socket:localhost:8009]
port=8009
host=127.0.0.1
lbfactor=1

[channel.socket:localhost:8010]
port=8010
host=127.0.0.1
lbfactor=1

[ajp13:localhost:8009]
channel=channel.socket:localhost:8009

[ajp13:localhost:8010]
channel=channel.socket:localhost:8010

[lb:localhost]
worker=ajp13:localhost:8009
worker=ajp13:localhost:8010

[uri:/scripts/Test]
group=lb:localhost


Can you please check to see what the issue is here. 
Comment 5 Henri Gomez 2004-03-29 08:31:10 UTC
Well I suspect that detection on user abort may not works fully in lb mode.

I'll check if it's the case in Apache 2 also.
Comment 6 Biju Kunjummen 2004-03-30 04:11:57 UTC
Thanks for checking Henri. I doubt if it is the lb entries though. I tried with 
the following configuration too, without a lb entry but still have the same 
error. Mod_jk does not have this problem - 
worker2.properties:

[shm]
file=E:/pr/logs/jk2.shm
size=1048576

[channel.socket:localhost:8009]
port=8009
host=127.0.0.1


[uri:/scripts/Test]
worker=ajp13:localhost:8009
Comment 7 Henri Gomez 2004-03-30 06:02:30 UTC
Good information.

The problem is to simulate what your doing, ie stop a request
to start a new one.

BTW, I could only test on Apache 2, no IIS here

Comment 8 Tim Funk 2004-12-14 01:36:48 UTC
As of November 15, 2004, JK2 is no longer supported. All bugs related to JK2 
will be marked as WONTFIX. In its place, some of its features have been 
backported to jk1. Most of those features will be seen in 1.2.7, which is 
slated for release on November 30th, 2004.

Another alternative is the ajp addition to mod_proxy which will be part of 
apache 2.

For more information on the Tomat connectors docs at
http://jakarta.apache.org/tomcat/connectors-doc/