Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] IllegalStateException in org.eclipse.jetty.server.HttpOutput#write(byte[], int, int)
  • From: Eric Theriault <eric@xxxxxxxxxxxxxxxxx>
  • Date: Fri, 10 Jan 2020 01:45:07 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=fitnesssyncer.com; dmarc=pass action=none header.from=fitnesssyncer.com; dkim=pass header.d=fitnesssyncer.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RaJAx76H33JZzeUGHM8F99VhjPDOfp1HvyDT8e+hFPQ=; b=hFuOcMCclo2VbesphxYBcEa8qq8GM5oFy/d2R/2CpXIXPkrb09zeHD8tYeIMFyCh4p9Uu7npNxxXzqSWmj6xATRcG6PFyiYW4n8ahpKNMKX62WgoAN3SXgp/e9X7Oy6+m24lm330FXQUjTysHJYUUxf/3mDV7334C/xv37kF/MV6UEDOCkfqunlrrVakRxOMA8px7GPipYZsK7lrAtcWQ0bYuLMzJSGxYp7TxFeo1vFMSNG5LmuE4KrpdZSdcfjPkT4L0/B2r+WARr8WodRy6k/HiHMdvFpzXyAb+WI4s82Sr3w2dOfqoG40n7pK7CeZh/egrTqUAUlBgav7IWl2dw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jCXwn19GNJgOGhTylvx8hoUG4cYBcdSyshUQeV0cKViSDyJ4pgGgCyiD4EqQJVWTXgWWL1nJ1HOC+asu7BAYESl2AmF9ZZ/SwoWhrm7esk//1DMMNCOhdi8N/wYER/uY4kTm6c2jX7vgjpXGWoKgzRuZbA5m18CYk+DcCDcWnOMhFheHqVCqLmZqTZrAsHImUycCKGSunqD/E4ea3KlaK583ptiVMhWBhqFEWTJvkWqIZjbfOxr3vml0X6XiQaLtImlFN05W16sSyvdFm3xU6MxmWWSsrgsdViHtMR62FMpt51Pi2oAGd8Mg+niV79yhCw+IO1rMJkFkYzoSbVsexw==
  • Delivered-to: jetty-users@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/jetty-users>
  • List-help: <mailto:jetty-users-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/jetty-users>, <mailto:jetty-users-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/jetty-users>, <mailto:jetty-users-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AQHVx1USiZjv5zVPhEKu7b+1mx+nyQ==
  • Thread-topic: IllegalStateException in org.eclipse.jetty.server.HttpOutput#write(byte[], int, int)

Hi--



I have just upgraded to 9.4.25.v20191220 and I have a piece of code that calls org.apache.commons.io.IOUtils.copy(inputStream, outputStream), where the outputStream is an instance of HttpOutput -- this code essentially just reads the code in chunks of 4096 bytes and writes that to the outputStream.

For one stream in particular (I'm still trying to figure out what is different with it), after sending 64,428 bytes, it sets the _apiState to BLOCKED.  When the next segment is copied over, however, the _apiState is still BLOCKED and falls into the default case which throws an IllegalStateException.

I've traced through the code and in line 806, I wonder why the code does not call onWriteComplete as would happen in line 835.  Is that the bug?  Or is there something more subtle here?



Looks like this was recently changed in https://github.com/eclipse/jetty.project/pull/4409 if I understand correctly.

This is the exception for reference:

java.lang.IllegalStateException: s=OPEN,api=BLOCKED,sc=false,e=null
at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:767)~[jetty-server-9.4.25.v20191220.jar:9.4.25.v20191220]
at org.springframework.security.web.util.OnCommittedResponseWrapper$SaveContextServletOutputStream.write(OnCommittedResponseWrapper.java:639) ~[spring-security-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:2315) ~[commons-io-2.6.jar:2.6]
at org.apache.commons.io.IOUtils.copy(IOUtils.java:2270) ~[commons-io-2.6.jar:2.6]
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:2291) ~[commons-io-2.6.jar:2.6]
at org.apache.commons.io.IOUtils.copy(IOUtils.java:2246) ~[commons-io-2.6.jar:2.6]

Thanks for any insight.




Eric

Back to the top