Bug 1245173 - [QE] (6.4.z) Unnecessary validation of numeric fields forces user to manually enter even default values when configuring infinispan subsystem
Summary: [QE] (6.4.z) Unnecessary validation of numeric fields forces user to manually...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Web Console
Version: 6.4.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: CR1
: EAP 6.4.5
Assignee: Ryan Emerson
QA Contact: Pavel Jelinek
URL:
Whiteboard:
Depends On:
Blocks: 1235745 1259955
TreeView+ depends on / blocked
 
Reported: 2015-07-21 11:33 UTC by Pavel Jelinek
Modified: 2017-01-17 11:42 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-17 11:40:38 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Screenshot of unexpected validation errors in infinispan configuration for EAP 6.4.4.Cp.CR3 (106.97 KB, image/png)
2015-09-29 11:20 UTC, Pavel Jelinek
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1278778 0 unspecified CLOSED [QE] (6.4.z) Web Console shows different Infinispan Eviction Max Entries value for default value 2021-02-22 00:41:40 UTC
Red Hat Issue Tracker HAL-776 0 Major Resolved Unnecessary validation of numeric fields forces user to manually enter even default values when configuring infinispan s... 2016-07-12 21:23:57 UTC

Internal Links: 1278778

Description Pavel Jelinek 2015-07-21 11:33:12 UTC
Description of problem:
Various forms related to infinispan configuration have numeric fields validation which requires valid (nonempty) numeric value even for attributes with default values. This behaviour forces user to manually enter even default values.

Version-Release number of selected component (if applicable):
HAL  2.5.6.Final-redhat-1

How reproducible:
always

Steps to Reproduce:
1. start EAP 6.4.2
2. in web console go to Configuration -> Subsystems -> Infinispan -> Cache Containers
3. click 'add' button
4. enter new container name let's say 'testcontainer', click 'save'
5. select 'testcontainer' in 'Cache Containers' table, select 'transport' tab, click 'edit'
6. check 'is transport defined', enter 'teststack' as stack name, click 'save'

Actual results:
not saved, Invalid numeric value warning under 'Lock Timeout' field

Expected results:
successfully saved, default value of 240000 ms shown in 'Lock Timeout' field

Comment 7 JBoss JIRA Server 2015-09-17 14:13:33 UTC
Heiko Braun <ike.braun> updated the status of jira HAL-776 to Resolved

Comment 8 Patrik Cyprian 2015-09-24 08:49:20 UTC
I verified this bug for jboss-eap-6.4.4.CP.CR3-patch.

Comment 9 Pavel Jelinek 2015-09-29 11:19:01 UTC
For EAP 6.4.4.CP.CR3 this seems to be just partially fixed. 
For standalone mode using web console go to Configuration > Infinispan > Invalidation caches > Details > Attrs > click Edit > select Batching > click Save. 
See attached screenshot with unexpected validation errors.

Comment 10 Pavel Jelinek 2015-09-29 11:20:34 UTC
Created attachment 1078299 [details]
Screenshot of unexpected validation errors in infinispan configuration for EAP 6.4.4.Cp.CR3

Comment 11 JBoss JIRA Server 2015-09-29 14:37:29 UTC
Ryan Emerson <remerson> updated the status of jira HAL-776 to Reopened

Comment 13 JBoss JIRA Server 2015-09-29 14:43:17 UTC
Ryan Emerson <remerson> updated the status of jira HAL-776 to Coding In Progress

Comment 17 JBoss JIRA Server 2015-10-12 10:24:15 UTC
Ryan Emerson <remerson> updated the status of jira HAL-776 to Resolved

Comment 18 Pavel Jelinek 2015-11-04 19:54:50 UTC
For EAP 6.4.5.CP.CR1 this is almost fixed. Still for most of Infinispan subsystem children there is the Eviction subtab with needless numeric validation of Max Entries input which prevent to change other Eviction tab fields as well.

Comment 19 Ryan Emerson 2015-11-05 09:34:43 UTC
Hi Pavel.  I believe that this behaviour is indeed correct.  The default max-entries value is -1, however if this value is set and eviction is enabled, upon startup EAP will throw the error listed below. Therefore, in this case I do not believe it makes sense to revert to the default value when eviction is enabled.  Also, it is still possible to disable eviction without having a max-entries value in place.  

09:30:12,536 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 31) JBAS014612: Operation ("add") failed - address: ([
    ("subsystem" => "infinispan"),
    ("cache-container" => "hibernate"),
    ("local-cache" => "entity")
]): org.infinispan.config.ConfigurationException: Eviction maxEntries value cannot be less than or equal to zero if eviction is enabled
	at org.infinispan.configuration.cache.EvictionConfigurationBuilder.validate(EvictionConfigurationBuilder.java:84)
	at org.infinispan.configuration.cache.ConfigurationBuilder.validate(ConfigurationBuilder.java:187)
	at org.infinispan.configuration.cache.ConfigurationBuilder.build(ConfigurationBuilder.java:203)
	at org.infinispan.configuration.cache.ConfigurationBuilder.build(ConfigurationBuilder.java:198)
	at org.jboss.as.clustering.infinispan.subsystem.CacheAdd.installRuntimeServices(CacheAdd.java:217)
	at org.jboss.as.clustering.infinispan.subsystem.CacheAdd.performRuntime(CacheAdd.java:186)
	at org.jboss.as.controller.AbstractAddStepHandler$1.execute(AbstractAddStepHandler.java:75) [jboss-as-controller-7.5.5.Final-redhat-SNAPSHOT.jar:7.5.5.Final-redhat-SNAPSHOT]
	at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:702) [jboss-as-controller-7.5.5.Final-redhat-SNAPSHOT.jar:7.5.5.Final-redhat-SNAPSHOT]
	at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:537) [jboss-as-controller-7.5.5.Final-redhat-SNAPSHOT.jar:7.5.5.Final-redhat-SNAPSHOT]
	at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:338) [jboss-as-controller-7.5.5.Final-redhat-SNAPSHOT.jar:7.5.5.Final-redhat-SNAPSHOT]
	at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:314) [jboss-as-controller-7.5.5.Final-redhat-SNAPSHOT.jar:7.5.5.Final-redhat-SNAPSHOT]
	at org.jboss.as.controller.ParallelBootOperationStepHandler$ParallelBootTask.run(ParallelBootOperationStepHandler.java:355) [jboss-as-controller-7.5.5.Final-redhat-SNAPSHOT.jar:7.5.5.Final-redhat-SNAPSHOT]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_45]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_45]
	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45]
	at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.2.Final-redhat-1.jar:2.1.2.Final-redhat-1]
09:30:12,577 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) "JBAS014784: Failed executing subsystem infinispan boot operations"
09:30:12,578 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014612: Operation ("parallel-subsystem-boot") failed - address: ([]) - failure description: "\"JBAS014784: Failed executing subsystem infinispan boot operations\""

Comment 20 Pavel Jelinek 2015-11-06 11:11:56 UTC
Hi Ryan, 
I see your point - default -1 max-entries means no eviction, but still the default value is valid for strategy NONE and neither no value nor -1 can be entered to the Max Entries field even if it is valid combination.

Comment 21 Ryan Emerson 2015-11-06 17:28:56 UTC
The default value is only valid for 1/5 combinations, so it really does not make sense for this field to be set as the default (-1) for all eviction types, especially as the user will be unaware of the consequences of this change until EAP has been restarted.  It is possible for max-entries to be set to 0, which is the equivalent of setting it to -1 when the Strategy is NONE, so a valid NONE configuration is possible at the moment[1].  

In terms of removing the need for a value to be entered, I believe there are two courses of action possible (other than keeping the current behaviour):

1) change the default value associated with Eviction. In my opinion this is a none starter as it is a change in EAP behaviour.  

2) Hardcode default max-entries values into HAL for eviction strategies that aren't NONE (e.g. 10000).  I believe this is better than 1, however you then have the issue of determining a sensible default value and introducing undocumented behaviour. 




[1] If NONE is configured with a max-entries value > 0, then the eviction type is set to LIRS by Infinispan behind the scenes with only a debug message to inform the user.

Comment 22 Ryan Emerson 2015-11-09 11:40:20 UTC
3) We keep the behaviour as is.  When NONE is selected, the user can enter 0 instead of -1.  Or they can just not enable eviction in the first place (same result).

Comment 23 Ryan Emerson 2015-11-09 13:27:23 UTC
Note, that solution 2 proposed above should also resolve [1] as the max-entries field will have to be changed to allow negative values, therefore -1 (the EAP default) will be displayed instead of zero.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1278778

Comment 24 Rostislav Svoboda 2015-11-09 15:24:50 UTC
Marking as verified. Remaining work will be tracked in BZ 1278778.

Comment 25 Petr Penicka 2017-01-17 11:40:38 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.

Comment 26 Petr Penicka 2017-01-17 11:42:22 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.


Note You need to log in before you can comment on or make changes to this bug.