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

Bug 920742

Summary: Add -Djboss.modules.write-indexes=false option to the SystemV init script
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Juan Hernández <juan.hernandez>
Component: RPMsAssignee: Fernando Nasser <fnasser>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 6.0.1CC: dandread, fnasser, jason.greene, jason.greene, jdoyle, myarboro, rsvoboda, shtripat
Target Milestone: ER5   
Target Release: EAP 6.1.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-16 20:25:44 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:
Bug Depends On:    
Bug Blocks: 901320    
Attachments:
Description Flags
New build with the fix none

Description Juan Hernández 2013-03-12 16:11:28 UTC
In the RPM packaging creating .jar.index files is error prone, as packages containing .jar files used by modules may be updated asynchronously to the main application server packages, thus making the .index files obsolete even if they are newer than the corresponding .jar files, as they may have been generated after the packaging date.

To avoid this issue we should add the -Djboss.modules.write-indexes=false option to the SystemV init script of the application server, so that .jar.index files are never generated.

Comment 1 Fernando Nasser 2013-03-12 19:05:51 UTC
Actually I think the best solution is for our RPMs to modify standalone.conf and domain.conf. The problem with the init scripts is that they won't work for domain mode launched VMs or if the user does ./standalone.sh on an RPM install.

--
Jason T. Greene

Comment 2 Juan Hernández 2013-03-12 19:22:40 UTC
If/when this is done can it be back-ported to EAP 6.0.1? I guess that the RHS-C team can't wait for EAP 6.1.

Comment 3 Pavel Janousek 2013-03-13 15:08:02 UTC
Before QE will give '+' to his Ack, I need discuss a little bit more due to not pretty clear state of scenarios we need to cover:

- domain mode - why this mode can't be covered by this new behavior as well? I understand this problem from SystemV init.d script limitation, but not from the root of new feature/behavior - why this feature can't be turned on/off in standalone/domain/host-slave.xml etc.? 

- the same question as previous for standalone.sh/domain.sh?

- update is supported use-case, so although this feature will be in place (= indexes aren't written on disk), who will delete old (obsoleted) indexes from disk (generated previously)? RPM management itself can't do that because it doesn't manage them at all.

Comment 4 Fernando Nasser 2013-03-13 15:16:45 UTC
I can only answer the last one above.  The jbossas-modules-eap has the removal of all index files in modules in the %post section.  We have tested it a few times in our test environment and it worked reliably.

The alternative is a proposed new flag that would ignore any existing index files.

Comment 5 Permaine Cheung 2013-03-19 17:19:24 UTC
With the option added to /usr/share/jbossas/bin/{standalone,domain}.conf, it gets picked up by both hte SystemV init script and standalone.sh/domain.sh

Comment 6 Permaine Cheung 2013-03-19 17:23:14 UTC
Created attachment 712824 [details]
New build with the fix

Comment 8 Pavel Janousek 2013-04-15 11:34:52 UTC
Can't be marked as Verified until we'll have RPM set for RHEL5 as well.

RHEL6 is verified and it is fixed already.

Comment 9 Rostislav Svoboda 2013-04-16 12:17:05 UTC
RHEL5 RPMs will be in ER5 (hopefully) so changing Target Milestone

Comment 10 Pavel Janousek 2013-04-26 08:22:48 UTC
Doesn't work after jdr.sh command invocation:

[root@dev130 tps]# find /usr/share/jbossas -name "*.jar.index*"
[root@dev130 tps]# /usr/share/jbossas/bin/jdr.sh
Initializing JBoss Diagnostic Reporter...
JDR started: Fri Apr 26 04:19:30 EDT 2013
JDR ended: Fri Apr 26 04:19:34 EDT 2013
JDR location: /mnt/qa/scratch/dev130/2013:14433/tps/jdr_13-04-26_04-19-30.zip
[root@dev130 tps]# find /usr/share/jbossas -name "*.jar.index*"
/usr/share/jbossas/modules/system/layers/base/org/apache/commons/io/main/commons-io.jar.index
/usr/share/jbossas/modules/system/layers/base/org/apache/commons/cli/main/commons-cli.jar.index
/usr/share/jbossas/modules/system/layers/base/org/apache/xalan/main/xalan.jar.index
/usr/share/jbossas/modules/system/layers/base/org/apache/xalan/main/serializer.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/threads/main/jboss-threads.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/remoting3/main/jboss-remoting.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/aesh/main/aesh.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/xnio/main/xnio-api.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/xnio/nio/main/xnio-nio.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/staxmapper/main/staxmapper.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/common-core/main/jboss-common-core.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/as/controller/main/jboss-as-controller.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/as/threads/main/jboss-as-threads.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/as/protocol/main/jboss-as-protocol.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/as/network/main/jboss-as-network.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/as/controller-client/main/jboss-as-controller-client.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/as/server/main/jboss-as-server.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/as/logging/main/jboss-as-logging.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/as/jdr/main/jboss-as-jdr.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/as/cli/main/jboss-as-cli.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/common-beans/main/jboss-common-beans.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/msc/main/jboss-msc.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/vfs/main/jboss-vfs.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/marshalling/main/jboss-marshalling.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/marshalling/river/main/jboss-marshalling-river.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/logging/main/jboss-logging.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/dmr/main/jboss-dmr.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/sasl/main/jboss-sasl.jar.index
/usr/share/jbossas/modules/system/layers/base/javax/inject/api/main/javax.inject.jar.index
[root@dev130 tps]#



It looks for me, using any command line tool from /usr/share/jbossas/bin directory generated some of *.jar.index, e.g. add-user.sh involves generation of these:
[root@dev130 tps]# find /usr/share/jbossas -name "*.jar.index*"

[root@dev130 tps]# /usr/share/jbossas/bin/add-user.sh 

What type of user do you wish to add? 
 a) Management User (mgmt-users.properties) 
 b) Application User (application-users.properties)
(a): 

Enter the details of the new user to add.
Realm (ManagementRealm) : 
Username : b
Password : 
Re-enter Password : 
About to add user 'b' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'b' to file '/etc/jbossas/standalone/mgmt-users.properties'
Added user 'b' to file '/etc/jbossas/domain/mgmt-users.properties'
Is this new user going to be used for one AS process to connect to another AS process? 
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
yes/no? yes
To represent the user add the following to the server-identities definition <secret value="MWJiYmJiYiE=" />
[root@dev130 tps]# find /usr/share/jbossas -name "*.jar.index*"
/usr/share/jbossas/modules/system/layers/base/org/jboss/threads/main/jboss-threads.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/staxmapper/main/staxmapper.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/common-core/main/jboss-common-core.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/as/controller/main/jboss-as-controller.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/as/controller-client/main/jboss-as-controller-client.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/as/domain-management/main/jboss-as-domain-management.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/as/logging/main/jboss-as-logging.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/msc/main/jboss-msc.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/vfs/main/jboss-vfs.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/logging/main/jboss-logging.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/dmr/main/jboss-dmr.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager.jar.index
/usr/share/jbossas/modules/system/layers/base/org/jboss/sasl/main/jboss-sasl.jar.index
/usr/share/jbossas/modules/system/layers/base/javax/inject/api/main/javax.inject.jar.index
[root@dev130 tps]#

Comment 11 Fernando Nasser 2013-04-29 14:43:30 UTC
Hi Jason, is thee another place where the flag has to be tested?  Or do we need to add the switch to other places as well?

Comment 12 Jason Greene 2013-08-01 13:45:40 UTC
In a previous IRC discussion I think we agreed to just patch the jboss modules in EAP to disable the indexing feature entirely.

Comment 14 Jason Greene 2013-08-02 18:03:17 UTC
David would need to produce a maintenance release of jboss modules with this change. It was already made upstream, it just needs to be cherry-picked on an older version.

Comment 15 Fernando Nasser 2013-08-02 18:56:59 UTC
Hi David, can you do it before the Aug 6 freeze?

Comment 16 Jason Greene 2013-08-06 14:27:09 UTC
Hi Fernando, according to David, the 1.2 and 1.3 release stream already default to not reading indexes, so I think there is nothing more to do here.

Comment 17 David M. Lloyd 2013-08-06 15:28:45 UTC
Just to make it clear, versions of JBoss Modules which ignore external indexes are:

- 1.2.0.Final and later
- 1.3.0.Beta1 and later

Any version of EAP which bundles any of these versions will not have this issue.

Comment 20 Fernando Nasser 2013-08-12 14:34:13 UTC
David Lloyd on comment #17 says the jboss modules 1.2.0.Final and later has the fix and EAP 6.1.1 is at 1.2.2, so it must contain David's fix.  Setting it to MODIFIED

Comment 21 Pavel Janousek 2013-08-15 09:35:43 UTC
Looks fixed.