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
Which version of jk2 ? Take a look at the latest in CVS which will be tagged 2.0.4 today
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++) {
Thanks to check against latest JK 2.0.4 (tagged today), tarball in few hours and reopen if needed
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.
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.
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
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
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/