Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 433C9200BB4 for ; Tue, 1 Nov 2016 11:21:26 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 41C69160AF7; Tue, 1 Nov 2016 10:21:26 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 61944160AE5 for ; Tue, 1 Nov 2016 11:21:25 +0100 (CET) Received: (qmail 1399 invoked by uid 500); 1 Nov 2016 10:21:24 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 1389 invoked by uid 99); 1 Nov 2016 10:21:24 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2016 10:21:24 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id E2CFFC07CC for ; Tue, 1 Nov 2016 10:21:23 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.189 X-Spam-Level: X-Spam-Status: No, score=-1.189 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999, T_FILL_THIS_FORM_SHORT=0.01] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id Fo9951G4-Qow for ; Tue, 1 Nov 2016 10:21:22 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 326ED5F2C3 for ; Tue, 1 Nov 2016 10:21:22 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 76B10E0045 for ; Tue, 1 Nov 2016 10:21:21 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 1F0FC3A05B6 for ; Tue, 1 Nov 2016 10:21:21 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1767471 - in /tomcat/trunk: java/org/apache/coyote/AbstractProcessor.java java/org/apache/coyote/AsyncStateMachine.java webapps/docs/changelog.xml Date: Tue, 01 Nov 2016 10:21:20 -0000 To: dev@tomcat.apache.org From: markt@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20161101102121.1F0FC3A05B6@svn01-us-west.apache.org> archived-at: Tue, 01 Nov 2016 10:21:26 -0000 Author: markt Date: Tue Nov 1 10:21:20 2016 New Revision: 1767471 URL: http://svn.apache.org/viewvc?rev=1767471&view=rev Log: If an I/O error occurs during async processing on a non-container thread, ensure that the onError() event is triggered. Modified: tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java?rev=1767471&r1=1767470&r2=1767471&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java Tue Nov 1 10:21:20 2016 @@ -103,6 +103,9 @@ public abstract class AbstractProcessor response.setStatus(500); } getLog().info(sm.getString("abstractProcessor.nonContainerThreadError"), t); + // Set the request attribute so that the async onError() event is + // fired when the error event is processed + request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t); socketWrapper.processSocket(SocketEvent.ERROR, true); } } Modified: tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java?rev=1767471&r1=1767470&r2=1767471&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java [UTF-8] (original) +++ tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java [UTF-8] Tue Nov 1 10:21:20 2016 @@ -69,30 +69,30 @@ import org.apache.tomcat.util.security.P * ERROR - Something went wrong. * * |-----------------»------| - * | \|/ - * | |----------«-------ERROR-----------------------------------«-------------------------------| - * | | complete() /|\/|\\ | - * | | | | \ | - * | | |-----»-------| | \-----------»----------| | - * | | | | |dispatch() | - * | | | | \|/ | - * | | | | |--|timeout() | | - * | | | post() | | \|/ | post() | - * | | | |---------- | --»DISPATCHED«---------- | --------------COMPLETING«-----| | - * | | | | | /|\/|\ | | | /|\ /|\ | | - * | | | | |---»- | ---| | |startAsync() | timeout()|--| | | | - * | | ^ ^ | | | | | | | | - * | | | | | |-- \ -----| | complete() | |post() | | - * | | | | | | \ | /--»----- | ---COMPLETE_PENDING-»-| | | - * | | | | | | \ | / | | | - * | | | | | ^ \ | / | | | - * | \|/ | | | | \ \|/ / post() | | | - * | MUST_COMPLETE-«- | - | --«----STARTING--»--------- | -------------| ^ | - * | /|\ /|\ | | complete() | \ | | complete() | | - * | | | | | | \ | post() | /----------| | - * | | | ^ | dispatch()| \ | |-----| | / | - * | | | | | | \ | | | | / | - * | | | | | \|/ \ | | \|/ \|/ / post() | + * | \|/ /-----------------------------------«------------------------------| + * | |----------«-------ERROR----------------------------«-------------------------------| | + * | | complete() /|\/|\\ | | + * | | | | \ | | + * | | |-----»-------| | \-----------»----------| | | + * | | | | |dispatch() | | + * | | | | \|/ | | + * | | | | |--|timeout() | | | + * | | | post() | | \|/ | post() | | + * | | | |---------- | --»DISPATCHED«---------- | --------------COMPLETING«-----| | | + * | | | | | /|\/|\ | | | /|\ /|\ | | | + * | | | | |---»- | ---| | |startAsync() | timeout()|--| | | | | + * | | ^ ^ | | | | | | | ^ | + * | | | | | |-- \ -----| | complete() | |post() | | | + * | | | | | | \ | /--»----- | ---COMPLETE_PENDING-»-| ^ | | + * | | | | | | \ | / | | | | + * | | | | | ^ \ | / | | | | + * | \|/ | | | | \ \|/ / post() | complete() | | | + * | MUST_COMPLETE-«- | - | --«----STARTING--»--------- | ------------| /---»-----| | | + * | /|\ /|\ | | complete() | \ | | / | ^ + * | | | | | | \ | post() | / error() | | + * | | | ^ | dispatch()| \ | |-----| | //------»-------| | + * | | | | | | \ | | | | // | + * | | | | | \|/ \ | | \|/\|/ // post() | * | | | | |--«--MUST_DISPATCH-----«-----| |--«--STARTED«---------«---------| | * | | | | dispatched() /|\ | \ / | | | | * | | | | | | \ / | | | | @@ -386,6 +386,7 @@ public class AsyncStateMachine { public synchronized void asyncError() { if (state == AsyncState.STARTING || + state == AsyncState.STARTED || state == AsyncState.DISPATCHED || state == AsyncState.TIMING_OUT || state == AsyncState.MUST_COMPLETE || Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1767471&r1=1767470&r2=1767471&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Tue Nov 1 10:21:20 2016 @@ -165,6 +165,11 @@ use. The values used by the executor may be set and obtained via the Executor. (markt) + + If an I/O error occurs during async processing on a non-container + thread, ensure that the onError() event is triggered. + (markt) + --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org