ICEfaces
  1. ICEfaces
  2. ICE-1252

BlockingResponseState maxUnflushed is hard coded and too low

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.5.2
    • Fix Version/s: 1.6
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Operating System: Windows XP
      Platform: PC

      Description

      maxUnflushed is hard-coded in BlockingResponseState to 10. some clients are
      running into "update queue exceeded " runtime exceptions. we should increase
      this and make it configurable.

      suggested fix:

      ---
      C:\work\frameworks\ICEfaces-1.5.3-src-build.5\ICEfaces-1.5.3-src\icefaces\core\src\com\icesoft\faces\webapp\xmlhttp\BlockingResponseState.java
      2007-01-19 10:23:06.000000000 -0700
      +++
      C:\work\frameworks\ICEfaces-1.5.3-src-build.5-Doppelganger\ICEfaces-1.5.3-src\icefaces\core\src\com\icesoft\faces\webapp\xmlhttp\BlockingResponseState.java
      2007-02-08 11:33:36.000000000 -0700
      @@ -67,13 +67,13 @@
           private Collection updates = new ArrayList();
           private String focusID;
           protected boolean isCancelled = false;
           protected String iceID;
           protected String viewNumber;
       
      - private final int maxUnflushed = 10;
      + private static int maxUnflushed = 10;
           protected int unflushed = 0;
           protected HttpSession session;
       
           /*
           maxUnflushed is hard-coded in BlockingResponseState to 10. some clients are
      running into "update queue exceeded " runtime exceptions. we should increase
      this and make it configurable.

      suggested fix:

      ---
      C:\work\frameworks\ICEfaces-1.5.3-src-build.5\ICEfaces-1.5.3-src\icefaces\core\src\com\icesoft\faces\webapp\xmlhttp\BlockingResponseState.java
      2007-01-19 10:23:06.000000000 -0700
      +++
      C:\work\frameworks\ICEfaces-1.5.3-src-build.5-Doppelganger\ICEfaces-1.5.3-src\icefaces\core\src\com\icesoft\faces\webapp\xmlhttp\BlockingResponseState.java
      2007-02-08 11:33:36.000000000 -0700
      @@ -67,13 +67,13 @@
           private Collection updates = new ArrayList();
           private String focusID;
           protected boolean isCancelled = false;
           protected String iceID;
           protected String viewNumber;
       
      - private final int maxUnflushed = 10;
      + private static int maxUnflushed = 10;
           protected int unflushed = 0;
           protected HttpSession session;
       
           /*
           Bug 1010: Added emptry constructor so that the extending class is not
           required to call the "real" constructor. This was agreed upon as the
      @@ -96,13 +96,21 @@
                   if (null == kicker) {
                       kicker = new Kicker();
                       session.setAttribute(iceID + "/kicker", kicker);
                   }
               }
               this.viewNumber = viewNumber;
      - }
      + }
      +
      + public static void setMaxUnflushed(int max){
      + maxUnflushed = max;
      + }
      +
      + public static int getMaxUnflushed(){
      + return maxUnflushed;
      + }
       
           public Object getEventLock() {
               return eventLock;
           }
       
           public String getFocusID() {

      ---
      C:\work\frameworks\ICEfaces-1.5.3-src-build.5\ICEfaces-1.5.3-src\icefaces\core\src\com\icesoft\faces\webapp\xmlhttp\BlockingServlet.java
      2007-01-19 10:23:06.000000000 -0700
      +++
      C:\work\frameworks\ICEfaces-1.5.3-src-build.5-Doppelganger\ICEfaces-1.5.3-src\icefaces\core\src\com\icesoft\faces\webapp\xmlhttp\BlockingServlet.java
      2007-02-08 11:43:41.000000000 -0700
      @@ -70,12 +70,14 @@
       public class BlockingServlet extends HttpServlet {
           private static final String CHARSET = "UTF-8";
           public static final String DEBUG_DOMUPDATE =
                   "com.icesoft.faces.debugDOMUpdate";
           public static final String STANDARD_REQUEST_SCOPE =
                   "com.icesoft.faces.standardRequestScope";
      + public static final String MAX_UNFLUSHED_UPDATES =
      + "com.icesoft.faces.maxUnflushedUpdates";
           public static boolean standardRequestScope = false;
           static boolean debugDOMUpdate = false;
       
           private ResponseStateManager stateManager;
       
           private static String postBackKey;
      @@ -103,12 +105,21 @@
                       .getResponseStateManager(config.getServletContext());
               ServletContext servletContext = config.getServletContext();
               debugDOMUpdate = "true".equalsIgnoreCase(servletContext
                       .getInitParameter(DEBUG_DOMUPDATE));
               standardRequestScope = "true".equalsIgnoreCase(servletContext
                       .getInitParameter(STANDARD_REQUEST_SCOPE));
      + try {
      + BlockingResponseState.setMaxUnflushed( Integer.parseInt(
      + servletContext.getInitParameter(MAX_UNFLUSHED_UPDATES)));
      + log.debug("set " + MAX_UNFLUSHED_UPDATES + " to " +
      BlockingResponseState.getMaxUnflushed() );
      + } catch (NumberFormatException e) {
      + BlockingResponseState.setMaxUnflushed( 20 );
      + log.debug("set " + MAX_UNFLUSHED_UPDATES + " to default 20" );
      + }
      +
           }
       
           protected void service(HttpServletRequest request,
                                  HttpServletResponse response)
                   throws ServletException, IOException {
       
      @@ -243,14 +254,18 @@
       
                   // Allow the context to clear Request scoped contexts if we're in a
      Seam environment.
                   bridgeExternalContext.clearRequestContext();
       
                   Map map = request.getParameterMap();
       
      - bridgeExternalContext.populateRequestParameters(
      - this.convertParametersMap(map));
      + String method = request.getPathInfo();
      + if ( "/send-updates".equals(method) ||
      + "/receive-send-updates".equals(method) ) {
      + bridgeExternalContext.populateRequestParameters(
      + this.convertParametersMap(map));
      + }
       
                   String[] cssUpdates = request.getParameterValues(
                           CurrentStyle.CSS_UPDATE_FIELD);
                   if (cssUpdates == null) {
                       if( log.isTraceEnabled() ) {
                           log.trace("service(-) No CSS update");
      @@ -277,13 +292,12 @@
       
                   state.setFocusID(request.getParameter("focus"));
                   
                   //Bug 264: The IncrementalNodeWriter instance has already been set
                   //in the PersistentFacesServlet and does not need to be set again here.
                   //session.setAttribute(IncrementalNodeWriter.NODE_WRITER, state);
      - String method = request.getPathInfo();
                   if ("/receive-updates".startsWith(method)) {
                       if( log.isTraceEnabled() ) {
                           log.trace("service(-) receive-updates");
                       }
                       state.block(request);: Added emptry constructor so that the extending class is not
           required to call the "real" constructor. This was agreed upon as the
      @@ -96,13 +96,21 @@
                   if (null == kicker) {
                       kicker = new Kicker();
                       session.setAttribute(iceID + "/kicker", kicker);
                   }
               }
               this.viewNumber = viewNumber;
      - }
      + }
      +
      + public static void setMaxUnflushed(int max){
      + maxUnflushed = max;
      + }
      +
      + public static int getMaxUnflushed(){
      + return maxUnflushed;
      + }
       
           public Object getEventLock() {
               return eventLock;
           }
       
           public String getFocusID() {

      ---
      C:\work\frameworks\ICEfaces-1.5.3-src-build.5\ICEfaces-1.5.3-src\icefaces\core\src\com\icesoft\faces\webapp\xmlhttp\BlockingServlet.java
      2007-01-19 10:23:06.000000000 -0700
      +++
      C:\work\frameworks\ICEfaces-1.5.3-src-build.5-Doppelganger\ICEfaces-1.5.3-src\icefaces\core\src\com\icesoft\faces\webapp\xmlhttp\BlockingServlet.java
      2007-02-08 11:43:41.000000000 -0700
      @@ -70,12 +70,14 @@
       public class BlockingServlet extends HttpServlet {
           private static final String CHARSET = "UTF-8";
           public static final String DEBUG_DOMUPDATE =
                   "com.icesoft.faces.debugDOMUpdate";
           public static final String STANDARD_REQUEST_SCOPE =
                   "com.icesoft.faces.standardRequestScope";
      + public static final String MAX_UNFLUSHED_UPDATES =
      + "com.icesoft.faces.maxUnflushedUpdates";
           public static boolean standardRequestScope = false;
           static boolean debugDOMUpdate = false;
       
           private ResponseStateManager stateManager;
       
           private static String postBackKey;
      @@ -103,12 +105,21 @@
                       .getResponseStateManager(config.getServletContext());
               ServletContext servletContext = config.getServletContext();
               debugDOMUpdate = "true".equalsIgnoreCase(servletContext
                       .getInitParameter(DEBUG_DOMUPDATE));
               standardRequestScope = "true".equalsIgnoreCase(servletContext
                       .getInitParameter(STANDARD_REQUEST_SCOPE));
      + try {
      + BlockingResponseState.setMaxUnflushed( Integer.parseInt(
      + servletContext.getInitParameter(MAX_UNFLUSHED_UPDATES)));
      + log.debug("set " + MAX_UNFLUSHED_UPDATES + " to " +
      BlockingResponseState.getMaxUnflushed() );
      + } catch (NumberFormatException e) {
      + BlockingResponseState.setMaxUnflushed( 20 );
      + log.debug("set " + MAX_UNFLUSHED_UPDATES + " to default 20" );
      + }
      +
           }
       
           protected void service(HttpServletRequest request,
                                  HttpServletResponse response)
                   throws ServletException, IOException {
       
      @@ -243,14 +254,18 @@
       
                   // Allow the context to clear Request scoped contexts if we're in a
      Seam environment.
                   bridgeExternalContext.clearRequestContext();
       
                   Map map = request.getParameterMap();
       
      - bridgeExternalContext.populateRequestParameters(
      - this.convertParametersMap(map));
      + String method = request.getPathInfo();
      + if ( "/send-updates".equals(method) ||
      + "/receive-send-updates".equals(method) ) {
      + bridgeExternalContext.populateRequestParameters(
      + this.convertParametersMap(map));
      + }
       
                   String[] cssUpdates = request.getParameterValues(
                           CurrentStyle.CSS_UPDATE_FIELD);
                   if (cssUpdates == null) {
                       if( log.isTraceEnabled() ) {
                           log.trace("service(-) No CSS update");
      @@ -277,13 +292,12 @@
       
                   state.setFocusID(request.getParameter("focus"));
                   
                   //ICE-263: The IncrementalNodeWriter instance has already been set
                   //in the PersistentFacesServlet and does not need to be set again here.
                   //session.setAttribute(IncrementalNodeWriter.NODE_WRITER, state);
      - String method = request.getPathInfo();
                   if ("/receive-updates".startsWith(method)) {
                       if( log.isTraceEnabled() ) {
                           log.trace("service(-) receive-updates");
                       }
                       state.block(request);

        Activity

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Philip Breau
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: