Return-Path: Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: (qmail 75068 invoked from network); 1 Oct 2008 07:18:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Oct 2008 07:18:38 -0000 Received: (qmail 57210 invoked by uid 500); 1 Oct 2008 07:18:36 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 57171 invoked by uid 500); 1 Oct 2008 07:18:36 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 57160 invoked by uid 99); 1 Oct 2008 07:18:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Oct 2008 00:18:35 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Oct 2008 07:17:39 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4BD94234C1F9 for ; Wed, 1 Oct 2008 00:17:44 -0700 (PDT) Message-ID: <882933149.1222845464309.JavaMail.jira@brutus> Date: Wed, 1 Oct 2008 00:17:44 -0700 (PDT) From: "Blake Sullivan (JIRA)" To: dev@myfaces.apache.org Subject: [jira] Created: (TRINIDAD-1245) High Availability Testing Support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org High Availability Testing Support --------------------------------- Key: TRINIDAD-1245 URL: https://issues.apache.org/jira/browse/TRINIDAD-1245 Project: MyFaces Trinidad Issue Type: New Feature Components: Archetype Affects Versions: 1.2.9-core Environment: All Reporter: Blake Sullivan Priority: Minor Most Servlet Engines support fail over for high availability by replicating changes the the Session state to other servers. This requires that all of the state and substate in the Session be Serializable. If the state is not Serializable, the failover will fail with a SerializationException and most likely the Session attribute key for which Serialization failed. This poses several problems for framework and application developers: 1) An actual high-availability configuration should not be necessary to test that the framework and application is using Session state correctly 2) The Servlet specification requires that an exception be thrown immediately when adding setting a non Serializable attribute on the Session when the Servlet engine is running in high-availibility mode. This enables the offending code to be quickly identified for simple case, but this requires: a) That the server be running in such a mode, which may be a pain to configure b) Some Servlet engines don't implement this feature 3) Knowing the offending key in the Session state is not very useful if the value of the key is an extremely complicated structure. In particular, determining precisely which attribute value on which component in the component state structure used in Trinidad state saving is a nightmare. The proposal is to address the problems by: 1) Making it possible to run Trinidad in a mode where unserializable state content and sets on Session attributes are detected 2) When a state Serialization failure is detected, more detailed failure information regarding the component and attribute key and value that failed can be determined by rerunning with additional, but slower settings In order to decrease runtime overhead, the proposal is that a System property: org.apache.myfaces.trinidad.CHECK_STATE_SERIALIZATION is used to control this behavior as this allows the behavior to be determined a class load time. The behavior is controlled by passing a comma-delimited set of case-insensitive values on the system property: NONE--no state serialization checks are performed (the default) ALL--perform all available tests (unless NONE is also specified, in which case NONE takes precedence) SESSION-Wrap the Session Map returned by the ExternalContext to test that only Serializable objects are placed in the Session Map, throwing a CastCastException if the Object is not Serializable TREE--aggressively attempt to serialize the component state during state saving and throw an exception if serialization fails COMPONENT--aggressively attempt to serialize each component subtree's state during state saving in order to identify the problem component (slow) PROPERTY--aggessively attempt to serialize each property value during state saving in order to identify the problem property (slow) For high availability testing, the tester would initially start off validating the Session and JSF state is Serializable by setting the system property to: -Dorg.apache.myfaces.trinidad.CHECK_STATE_SERIALIZATION=session,tree If a JSF state serialization is detected, the test is rerun with the component and property flags enabled: -Dorg.apache.myfaces.trinidad.CHECK_STATE_SERIALIZATION=all Programmatic access to these flags would be on the StateUtils class: /** * Returns true if components should be checked for * serializability when when generating the view's state object. *

* By default component state serialization checking is off. It can be * enabled by setting the system property * org.apache.myfaces.trinidad.CHECK_STATE_SERIALIZATION * to all or, more rarely, adding component to the * comma-separated list of serialization checks to perform. *

* As property serialization checking is expensive, it is usually * only enabled after component tree serialization checking has detected * a problem. In addition, since component serialization checking only * detects the problem component, it is usually combined with * property state serialization checking either by specifying all. * @return * @see #checkComponentTreeStateSerialization */ public static boolean checkComponentStateSerialization(FacesContext context) /** * Returns true if the component tree should be checked for * serializability when when generating the view's state object. *

* By default component tree state serialization checking is off. It can be * enabled by setting the system property * org.apache.myfaces.trinidad.CHECK_STATE_SERIALIZATION * to all or, more commonly, adding tree to the * comma-separated list of serialization checks to perform. *

* Because unserializable objects defeat fail-over, it is important to * check for serializability when testing applications. While component * tree state serializability checking isn't cheap, it is much faster to * initially only enable checking of the component tree and then switch * to all testing to determine the problem component and * property when the component tree testing determines a problem. * @return * @see #checkComponentStateSerialization */ public static boolean checkComponentTreeStateSerialization(FacesContext context) /** * Returns true if Object written to the SessionMap should be checked for * Serializability when put is called. *

* Configuring this property allows this aspect of high-availability to be tested without * configuring the server to run in high-availability mode. *

* By default session serialization checking is off. It can be * enabled by setting the system property * org.apache.myfaces.trinidad.CHECK_STATE_SERIALIZATION * to all or, more commonly, adding session to the * comma-separated list of serialization checks to perform. * @return * @see #checkComponentStateSerialization * @see #checkComponentTreeStateSerialization */ public static boolean checkSessionSerialization(ExternalContext extContext) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.