Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1105564

Summary: Tag pooling doesn't work with NIO2 connector
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Radim Hatlapatka <rhatlapa>
Component: Web, DocumentationAssignee: Rémy Maucherat <rmaucher>
Status: CLOSED NOTABUG QA Contact: Radim Hatlapatka <rhatlapa>
Severity: medium Docs Contact: Russell Dickenson <rdickens>
Priority: unspecified    
Version: 6.3.0CC: rmaucher
Target Milestone: ---Keywords: Reopened
Target Release: EAP 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-09 14:13:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
simple web app with a custom tag with showing tag-pooling behavior
none
simple web app for testing tag pooling behavior which doesn't require page reloads none

Description Radim Hatlapatka 2014-06-06 12:08:54 UTC
Created attachment 902910 [details]
simple web app with a custom tag with showing tag-pooling behavior

Description of problem:
Tag pooling doesn't work with NIO2 connector


How reproducible: always


Steps to Reproduce:
1. enable NIO2 connector
2. check that tag-pooling is enabled: /subsystem=web/configuration=jsp-configuration:read-attribute(name=tag-pooling) 
3. deploy jsp web application containing custom tag which makes use of previous state (you can use the web application from attachment)
4. go to http://localhost:8080/jsp-with-custom-tag/index.jsp
5. reload the page several time

Actual results: The page content is not changing


Expected results: The attribute values contains appended values after each reload


Additional info:
with JIO connector it works as expected

Comment 1 Rémy Maucherat 2014-06-10 06:59:34 UTC
I don't see how the connector could have any impact on tag pooling. But the tag pool is thread local and the threading behavior is very different from jio, this could cause differences.

Comment 2 Rémy Maucherat 2014-08-26 13:51:37 UTC
The threading of the connector is different (basically it fills the thread pool) and since Jasper uses per thread tag pools, the testing is inappropriate. On a busy server, JIO actually does the same thing, so there should be no bug to fix here.

Comment 3 Rémy Maucherat 2014-09-08 12:13:40 UTC
Rephrasing a bit. Tag pooling uses per thread tag pools, and there are two different threading behaviors:
- java.io does blocking IO for keepalive so will indefinitely use the same thread with the scenario described
- NIO2 uses an internal polling mechanism for keepalive, and very often forks new threads until the executor is full, as a result subsequent reloads will very rarely use a previous thread unless the test uses a very large amount of requests

Comment 4 Radim Hatlapatka 2014-09-08 12:22:08 UTC
From customer PoV the behavior differs and for NIO2 connector it obviously doesn't work as expected.

This needs to be at least documented.


The testing of tag-pooling is done by checking by checking that custom tag object is reused. The reusability is tested by appending some text to previous one and then there is tested whether with each page access the text is cleaned to original or whether it contains text from previous page access (with tag-pooling enabled those data should not be cleaned, with tag-pooling disabled it should be cleaned as new object is used). 

I don't see anything inappropriate with the testing, please if you see anything inappropriate with this approach let me know.

Comment 5 Radim Hatlapatka 2014-09-08 12:24:18 UTC
This needs to be at least documented. Adding documentation as component.

Comment 6 Rémy Maucherat 2014-09-08 12:29:20 UTC
Ok, if you really believe your test is accurate to check tag pooling, please assume it doesn't work with NIO2 then.

It shouldn't be a critical issue since it is not the default connector and tag pooling may not be a very large performance gain anyway, but may use a significant amount of memory, depending on the situation.

Comment 11 Radim Hatlapatka 2014-09-09 14:13:07 UTC
Created attachment 935757 [details]
simple web app for testing tag pooling behavior which doesn't require page reloads

I have created new test, which is able to test tag pooling using one request, thereby it is not exposed to NIO2 having for each request a new thread.

Whether tag-pooling works or not is visible by seeing whether second tag contains value from the first one or is null.