Friday, January 21, 2011

HTTP GET

Ran into a nasty problem with one of our webapps recently.

We have some jobs that enable and disable a number of weblogic entities (OSB proxies/ JMS queue/ Soa Composites). We noticed that some of these were failing.

The exception we saw was ERROR: Another session operation is in progress. Please retry later.

As part of our process (to disable OSB proxies) we need to create and use a weblogic session. We only create one instance, and then activate the changes at the end. But in our logs a 2nd session was been created.

After careful inspection it turned out the second session was been generated by a different thread. Checking the access.log confirmed a 2nd request arriving 30 seconds after the first. (This maybe certain versions of Firefox.. Need more investigation)

This it appears is because we were using a HTTP Get (we should be using Post) for our request. Apparently on seeing no response/ ack etc, the browser was re-submiting the request on its own accord.

So now we had 2 conflicting requests both trying to access the weblogic session. Obviously the 2nd fails. This was then reported to the user.

Meanwhile the original request succeeds silently.

Our fix is to change the request to a post.

Also adding a token to the post request to prevent against double submit.

….

2011-01-18 20:51:21,335 [DEBUG] myClass:[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)':- Realizing changes in the session: WebAdminTool1295383871917

2011-01-18 20:51:21,759 [DEBUG] myClass:[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)':- Setting service OSBProxy::false to true

2011-01-18 20:51:28,551 [INFO ] ie.bge.middleware.jmswebtool.data.impl.jmx.QueuePersistenceJmxImpl:[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)':- Result from pauseConsumption: null

2011-01-18 20:51:28,554 [INFO ] ie.bge.middleware.jmswebtool.data.impl.jmx.QueuePersistenceJmxImpl:[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)':- Result from pauseConsumption: null

...

2011-01-18 20:51:28,644 [DEBUG] myClass :[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)':- Creating new Weblogic session WebAdminTool1295383888606

2011-01-18 20:51:48,669 [ERROR] myClass:[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)':- ERROR: Another session operation is in progress. Please retry later.

...

2011-01-18 20:51:58,571 [DEBUG] myClass:[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)':- Activated changes in the session: WebAdminTool1295383871917

No comments: