ICEfaces
  1. ICEfaces
  2. ICE-10072

Showcase, IE9, Wildfly 8.0.0 server error: "java.io.IOException: UT 000029: Channel was closed mid chunk"

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: EE-3.3.0.GA_P02
    • Fix Version/s: 4.0, EE-3.3.0.GA_P03
    • Component/s: Sample Apps
    • Labels:
      None
    • Environment:
      Wildfly 8.0.0 Final server, IE 9, ace:showcase
    • Assignee Priority:
      P1

      Description

      While navigating around showcase deployed onto Wildfly 8.0.0 Final and using IE 9 a server error appears (not able to reliably reproduce). I was not able to reproduce this with Chrome or Firefox
      15:34:36,479 ERROR [io.undertow.request] (default task-1) Blocking request failed HttpServerExchange{ POST /showcase/javax.faces.resource/listen.icepush.xml.jsf}: java.lang.RuntimeException: java.io.IOException: UT 000029: Channel was closed mid chunk, if you have attempted to write chunked data you cannot shutdown the channel until after it has all been written.
             at io.undertow.servlet.spec.HttpServletResponseImpl.responseDone(HttpServletResponseImpl.java:527)
             at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java :287)
             at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:22 7)
             at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73)
             at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:14 6)
             at io.undertow.server.Connectors.executeRootHandler(Connectors.java:168)
             at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:687)
             at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_07 ]
             at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_07 ]
             at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_07]

        Activity

        Liana Munroe created issue -
        Ken Fyten made changes -
        Field Original Value New Value
        Fix Version/s EE-3.3.0.GA_P02 [ 11371 ]
        Affects Version/s EE-3.3.0.GA_P02 [ 11371 ]
        Priority Major [ 3 ] Trivial [ 5 ]
        Affects Sample App./Tutorial [ 10001 ]
        Ken Fyten made changes -
        Security Private [ 10001 ]
        Ken Fyten made changes -
        Summary Showcase, Wildfly 8.0.0 Final Server error Showcase, Wildfly 8.0.0 server error: "java.io.IOException: UT 000029: Channel was closed mid chunk"
        Ken Fyten made changes -
        Summary Showcase, Wildfly 8.0.0 server error: "java.io.IOException: UT 000029: Channel was closed mid chunk" Showcase, IE9, Wildfly 8.0.0 server error: "java.io.IOException: UT 000029: Channel was closed mid chunk"
        Hide
        Ken Fyten added a comment -

        Closing as Won't Fix as there are no ICEfaces classes in the stack trace. Likely IE9 bug and/or overzealous Wildfly server logging.

        Show
        Ken Fyten added a comment - Closing as Won't Fix as there are no ICEfaces classes in the stack trace. Likely IE9 bug and/or overzealous Wildfly server logging.
        Ken Fyten made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Won't Fix [ 2 ]
        Ken Fyten made changes -
        Resolution Won't Fix [ 2 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Affects Sample App./Tutorial [ 10001 ]
        Assignee Mircea Toma [ mircea.toma ]
        Assignee Priority P3 [ 10012 ]
        Ken Fyten made changes -
        Fix Version/s EE-3.3.0.GA_P03 [ 11572 ]
        Fix Version/s EE-3.3.0.GA_P02 [ 11371 ]
        Hide
        Ken Fyten added a comment - - edited

        Re-opened after further investigation indicates that we might be able to trap this to avoid the annoying excess logging.

        Deryk says:

        Perhaps a Jack and/or Mircea thing. In the BlockingConnectionServer, the IOException (Connection rest by peer) bubbles up and is caught and rethrown as a RuntimeException. Doesn’t appear to be any closing done on the response from what I can tell:

         
           private boolean respondIfPendingRequest(ResponseHandler handler) {
                Request previousRequest = (Request) pendingRequest.poll();
                if (previousRequest != null) {
                    if (log.isLoggable(Level.FINE)) {
                        log.log(Level.FINE, "Pending request for PushIDs '" + participatingPushIDs + "', trying to respond.");
                    }
                    try {
                        recordResponseTime();
                        previousRequest.respondWith(handler);
                        return true;
                    } catch (Exception e) {
                        throw new RuntimeException(e);  //<- Line 180
                    }
                }
                return false;
            }
        

         
        In the Undertow code, it still thinks that there are chunks left:

        http://grepcode.com/file/repo1.maven.org/maven2/io.undertow/undertow-core/1.0.0.Final/io/undertow/conduits/ChunkedStreamSinkConduit.java?av=f#276

         
         @Override
        278    public void terminateWrites() throws IOException {
        279        if(anyAreSet(state, FLAG_WRITES_SHUTDOWN)) {
        280            return;
        281        }
        282        if (this.chunkleft != 0) {
        283            throw UndertowMessages.MESSAGES.chunkedChannelClosedMidChunk();
        284        }
        285        if (!anyAreSet(state, FLAG_FIRST_DATA_WRITTEN)) {
        286            //if no data was actually sent we just remove the transfer encoding header, and set content length 0
        287            //TODO: is this the best way to do it?
        288            //todo: should we make this behaviour configurable?
        289            responseHeaders.put(Headers.CONTENT_LENGTH, "0"); //according to the spec we don't actually need this, but better to be safe
        290            responseHeaders.remove(Headers.TRANSFER_ENCODING);
        291            state |= FLAG_NEXT_SHUTDOWN | FLAG_WRITES_SHUTDOWN;
        292            if(anyAreSet(state, CONF_FLAG_PASS_CLOSE)) {
        293                next.terminateWrites();
        294            }
        295        } else {
        296            createLastChunk(false);
        297            state |= FLAG_WRITES_SHUTDOWN;
        298        }
        299    }
        Show
        Ken Fyten added a comment - - edited Re-opened after further investigation indicates that we might be able to trap this to avoid the annoying excess logging. Deryk says: Perhaps a Jack and/or Mircea thing. In the BlockingConnectionServer, the IOException (Connection rest by peer) bubbles up and is caught and rethrown as a RuntimeException. Doesn’t appear to be any closing done on the response from what I can tell: private boolean respondIfPendingRequest(ResponseHandler handler) { Request previousRequest = (Request) pendingRequest.poll(); if (previousRequest != null ) { if (log.isLoggable(Level.FINE)) { log.log(Level.FINE, "Pending request for PushIDs '" + participatingPushIDs + "', trying to respond." ); } try { recordResponseTime(); previousRequest.respondWith(handler); return true ; } catch (Exception e) { throw new RuntimeException(e); //<- Line 180 } } return false ; }   In the Undertow code, it still thinks that there are chunks left: http://grepcode.com/file/repo1.maven.org/maven2/io.undertow/undertow-core/1.0.0.Final/io/undertow/conduits/ChunkedStreamSinkConduit.java?av=f#276 @Override 278 public void terminateWrites() throws IOException { 279 if (anyAreSet(state, FLAG_WRITES_SHUTDOWN)) { 280 return ; 281 } 282 if ( this .chunkleft != 0) { 283 throw UndertowMessages.MESSAGES.chunkedChannelClosedMidChunk(); 284 } 285 if (!anyAreSet(state, FLAG_FIRST_DATA_WRITTEN)) { 286 // if no data was actually sent we just remove the transfer encoding header, and set content length 0 287 //TODO: is this the best way to do it? 288 //todo: should we make this behaviour configurable? 289 responseHeaders.put(Headers.CONTENT_LENGTH, "0" ); //according to the spec we don't actually need this , but better to be safe 290 responseHeaders.remove(Headers.TRANSFER_ENCODING); 291 state |= FLAG_NEXT_SHUTDOWN | FLAG_WRITES_SHUTDOWN; 292 if (anyAreSet(state, CONF_FLAG_PASS_CLOSE)) { 293 next.terminateWrites(); 294 } 295 } else { 296 createLastChunk( false ); 297 state |= FLAG_WRITES_SHUTDOWN; 298 } 299 }
        Hide
        Mircea Toma added a comment -

        Modified respondIfPendingRequest method to avoid re-throwing the caught exceptions. Instead the IOException is captured and just a debug level message is logged. Any other exception is still caught and an error level message is logged instead.

        Show
        Mircea Toma added a comment - Modified respondIfPendingRequest method to avoid re-throwing the caught exceptions. Instead the IOException is captured and just a debug level message is logged. Any other exception is still caught and an error level message is logged instead.
        Mircea Toma made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 4.0 [ 11382 ]
        Hide
        Liana Munroe added a comment -

        Not able to reproduce. Wildfly 8.0.0 Final, Chrome, FF, IE 9 (2 versions), IE 10. EE-3.3.0 maintenance branch build 440.

        Show
        Liana Munroe added a comment - Not able to reproduce. Wildfly 8.0.0 Final, Chrome, FF, IE 9 (2 versions), IE 10. EE-3.3.0 maintenance branch build 440.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #41324 Tue Jun 10 17:07:43 MDT 2014 mircea.toma ICE-10072 Avoid re-throwing captured exceptions in respondIfPendingRequest method.
        Files Changed
        Commit graph MODIFY /icepush/trunk/icepush/core/src/main/java/org/icepush/BlockingConnectionServer.java
        Hide
        Liana Munroe added a comment -

        This same server error issue occurs on Icefaces 4 trunk when tested using Wildfly 8.1.0 and IE 11.
        Error seen when interacting with the following Showcase demos:
        Accordion, gMap, qrCode, radioButton, richTextEntry, simpleSelectOneMenu, sliderEntry, submitMonitor, tabSet, textEntry as well as the auction test application.
        Server error seen:
        11:23:12,500 ERROR [io.undertow.request] (default task-5) Blocking request failed HttpServerExchange

        { POST /showcase/javax.faces.resource/listen.icepush.xml.jsf}

        : java.lang.RuntimeException: java.io.IOException: UT000029: Channel was closed mid chunk, if you have attempted to write chunked data you cannot shutdown the channel until after it has all been written......

        Show
        Liana Munroe added a comment - This same server error issue occurs on Icefaces 4 trunk when tested using Wildfly 8.1.0 and IE 11. Error seen when interacting with the following Showcase demos: Accordion, gMap, qrCode, radioButton, richTextEntry, simpleSelectOneMenu, sliderEntry, submitMonitor, tabSet, textEntry as well as the auction test application. Server error seen: 11:23:12,500 ERROR [io.undertow.request] (default task-5) Blocking request failed HttpServerExchange { POST /showcase/javax.faces.resource/listen.icepush.xml.jsf} : java.lang.RuntimeException: java.io.IOException: UT000029: Channel was closed mid chunk, if you have attempted to write chunked data you cannot shutdown the channel until after it has all been written......
        Liana Munroe made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Ken Fyten made changes -
        Assignee Priority P3 [ 10012 ] P1 [ 10010 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #41842 Wed Jul 23 12:16:10 MDT 2014 mircea.toma ICE-10072 Modified handler to not flush the content of the servlet's output stream.
        Files Changed
        Commit graph MODIFY /icepush/trunk/icepush/core/src/main/java/org/icepush/http/standard/ContentTypeContentHandler.java
        Hide
        Mircea Toma added a comment -

        Modified ContentTypeContentHandler to not flush the content of the servlet's output stream since the server can choose to stream the content after the flush method is called. Anyway calling flush on the servlet output stream was never necessary.

        Show
        Mircea Toma added a comment - Modified ContentTypeContentHandler to not flush the content of the servlet's output stream since the server can choose to stream the content after the flush method is called. Anyway calling flush on the servlet output stream was never necessary.
        Mircea Toma made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Mircea Toma added a comment -

        Applied fix to maintenance branch.

        Show
        Mircea Toma added a comment - Applied fix to maintenance branch.
        Hide
        Liana Munroe added a comment - - edited

        Verified Icefaces 4 trunk Jenkins Build 532 r41846 with Wildfly 8.1.0, Icefaces EE -3.3.0, r41846 maintenance branch Wildfly 8.0.0, using IE11

        Show
        Liana Munroe added a comment - - edited Verified Icefaces 4 trunk Jenkins Build 532 r41846 with Wildfly 8.1.0, Icefaces EE -3.3.0, r41846 maintenance branch Wildfly 8.0.0, using IE11
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Liana Munroe
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: