From leleuj at gmail.com Thu May 7 07:37:09 2015 From: leleuj at gmail.com (=?UTF-8?B?SsOpcsO0bWUgTEVMRVU=?=) Date: Thu, 7 May 2015 13:37:09 +0200 Subject: [undertow-dev] undertow-pac4j v1.0: the security library for Undertow Message-ID: Hi, I?m proud to announce the release of undertow-pac4j v1.0.0 for Undertow ( https://github.com/pac4j/undertow-pac4j). undertow-pac4j is a security library based on the version 1.7 of the authentication/authorization engine pac4j (http://www.pac4j.org) which is also implemented for many frameworks: J2E, Play, Vertx, Spring Security, Ratpack, Shiro, CAS, Spark... It supports authentication and user profile retrieval for multiple protocols: CAS, OAuth, OpenID, SAML, HTTP, Google App Engine, OpenID Connect and therefore for numerous identity providers: Facebook, Twitter, Google? I?m looking for maintainers and contributors for undertow-pac4j (and pac4j), to add support for direct authenticated calls and roles / authorizations management (already available in pac4j) for example. Any help will be appreciated. A demo is available at: https://github.com/pac4j/undertow-pac4j-demo If you have any questions, please use the pac4j mailing lists: https://groups.google.com/forum/?fromgroups#!forum/pac4j-users & https://groups.google.com/forum/?fromgroups#!forum/pac4j-dev. Thanks. Best regards, J?r?me -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20150507/8fbd16a9/attachment-0001.html From sdouglas at redhat.com Thu May 7 20:21:32 2015 From: sdouglas at redhat.com (Stuart Douglas) Date: Thu, 7 May 2015 20:21:32 -0400 (EDT) Subject: [undertow-dev] undertow-pac4j v1.0: the security library for Undertow In-Reply-To: References: Message-ID: <2082304925.18626487.1431044492810.JavaMail.zimbra@redhat.com> Nice! Stuart ----- Original Message ----- > From: "J?r?me LELEU" > To: undertow-dev at lists.jboss.org > Cc: pac4j-dev at googlegroups.com, pac4j-users at googlegroups.com > Sent: Thursday, 7 May, 2015 9:37:09 PM > Subject: [undertow-dev] undertow-pac4j v1.0: the security library for Undertow > > > > Hi, > > > I?m proud to announce the release of undertow-pac4j v1.0.0 for Undertow ( > https://github.com/pac4j/undertow-pac4j ). > > > undertow-pac4j is a security library based on the version 1.7 of the > authentication/authorization engine pac4j ( http://www.pac4j.org ) which is > also implemented for many frameworks: J2E, Play, Vertx, Spring Security, > Ratpack, Shiro, CAS, Spark... > > > It supports authentication and user profile retrieval for multiple protocols: > CAS, OAuth, OpenID, SAML, HTTP, Google App Engine, OpenID Connect and > therefore for numerous identity providers: Facebook, Twitter, Google? > > > I?m looking for maintainers and contributors for undertow-pac4j (and pac4j), > to add support for direct authenticated calls and roles / authorizations > management (already available in pac4j) for example. Any help will be > appreciated. > > > A demo is available at: https://github.com/pac4j/undertow-pac4j-demo > > > If you have any questions, please use the pac4j mailing lists: > https://groups.google.com/forum/?fromgroups#!forum/pac4j-users & > https://groups.google.com/forum/?fromgroups#!forum/pac4j-dev . > > > Thanks. > > Best regards, > > J?r?me > > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From greg.hellings at gmail.com Mon May 11 16:45:37 2015 From: greg.hellings at gmail.com (Greg Hellings) Date: Mon, 11 May 2015 15:45:37 -0500 Subject: [undertow-dev] Compile error on clean checkout Message-ID: Undertow, I was trying to do a fresh pull and build of Undertow. I've tried on both the master branch and on the 1.2.x series. Both of them fail the compile goal with different errors. From master I get [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project undertow-servlet: Compilation failure [ERROR] /home/greg/build/undertow/servlet/src/main/java/io/undertow/servlet/spec/ServletPrintWriterDelegate.java:[28,99] incompatible types: java.lang.reflect.Constructor cannot be converted to java.lang.reflect.Constructor >From 1.2.x I get this error: [ERROR] Failed to execute goal on project undertow-servlet: Could not resolve dependencies for project io.undertow:undertow-servlet:jar:1.2.6.Final-SNAPSHOT: Failure to find io.undertow:undertow-core:jar:tests:1.2.6.Final-SNAPSHOT in http://repository.jboss.org/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of jboss-public-repository-group has elapsed or updates are forced -> [Help 1] I'm building this on Fedora 21 with Java 1.8.0_31 OpenJDK and Maven 3.2.2, both from the Fedora yum repositories. I get very similar errors trying to build on Windows 8.1 with Java 8 and Mavent 3.2.5. I can't help but imagine there is some environmental setup step that I'm missing. Is there any pointer to documentation around getting a development environment configured that I'm missing? Thanks! --Greg From kwills at redhat.com Mon May 11 16:57:51 2015 From: kwills at redhat.com (Ken Wills) Date: Mon, 11 May 2015 15:57:51 -0500 Subject: [undertow-dev] Compile error on clean checkout In-Reply-To: References: Message-ID: <20150511205751.GA23025@fedor.yaberk.int> On Mon, May 11, 2015 at 03:45:37PM -0500, Greg Hellings wrote: > I'm building this on Fedora 21 with Java 1.8.0_31 OpenJDK and Maven > 3.2.2, both from the Fedora yum repositories. I get very similar > errors trying to build on Windows 8.1 with Java 8 and Mavent 3.2.5. I > can't help but imagine there is some environmental setup step that I'm > missing. Is there any pointer to documentation around getting a > development environment configured that I'm missing? Builds for me on F21, Maven 3.2.2 with OpenJDK8(1.8.0_45) and Oracle JDK 8 (1.8.0_45). Did you perhaps forget to configure maven? https://developer.jboss.org/wiki/MavenGettingStarted-Users Ken From greg.hellings at gmail.com Mon May 11 17:13:23 2015 From: greg.hellings at gmail.com (Greg Hellings) Date: Mon, 11 May 2015 16:13:23 -0500 Subject: [undertow-dev] Compile error on clean checkout In-Reply-To: <20150511205751.GA23025@fedor.yaberk.int> References: <20150511205751.GA23025@fedor.yaberk.int> Message-ID: Ken, Indeed, I did not know about that page (I made my way in through the undertow.io site where I didn't find docs like that). Adding that to my settings.xml file means that master now gives the same error that the 1.2.x series gave: [ERROR] Failed to execute goal on project undertow-servlet: Could not resolve dependencies for project io.undertow:undertow-servlet:jar:1.3.0.Beta1-SNAPSHOT: Could not find artifact io.undertow:undertow-core:jar:tests:1.3.0.Beta1-SNAPSHOT in jboss-public-repository-group (https://repository.jboss.org/nexus/content/groups/public-jboss/) -> [Help 1] --Greg On Mon, May 11, 2015 at 3:57 PM, Ken Wills wrote: > On Mon, May 11, 2015 at 03:45:37PM -0500, Greg Hellings wrote: >> I'm building this on Fedora 21 with Java 1.8.0_31 OpenJDK and Maven >> 3.2.2, both from the Fedora yum repositories. I get very similar >> errors trying to build on Windows 8.1 with Java 8 and Mavent 3.2.5. I >> can't help but imagine there is some environmental setup step that I'm >> missing. Is there any pointer to documentation around getting a >> development environment configured that I'm missing? > > Builds for me on F21, Maven 3.2.2 with OpenJDK8(1.8.0_45) and Oracle JDK 8 (1.8.0_45). Did you perhaps forget to configure maven? > > https://developer.jboss.org/wiki/MavenGettingStarted-Users > > Ken From kwills at redhat.com Mon May 11 17:25:11 2015 From: kwills at redhat.com (Ken Wills) Date: Mon, 11 May 2015 16:25:11 -0500 Subject: [undertow-dev] Compile error on clean checkout In-Reply-To: References: <20150511205751.GA23025@fedor.yaberk.int> Message-ID: <20150511212511.GB23025@fedor.yaberk.int> On Mon, May 11, 2015 at 04:13:23PM -0500, Greg Hellings wrote: > Ken, > > Indeed, I did not know about that page (I made my way in through the > undertow.io site where I didn't find docs like that). Adding that to > my settings.xml file means that master now gives the same error that > the 1.2.x series gave: > [ERROR] Failed to execute goal on project undertow-servlet: Could not > resolve dependencies for project > io.undertow:undertow-servlet:jar:1.3.0.Beta1-SNAPSHOT: Could not find > artifact io.undertow:undertow-core:jar:tests:1.3.0.Beta1-SNAPSHOT in > jboss-public-repository-group > (https://repository.jboss.org/nexus/content/groups/public-jboss/) -> > [Help 1] Odd, that (1.2.x) builds for me too (mvn clean install -U). I think that artifact might be built by the project itself. I'll take a quick look at what master builds. Ken From greg.hellings at gmail.com Mon May 11 17:30:03 2015 From: greg.hellings at gmail.com (Greg Hellings) Date: Mon, 11 May 2015 16:30:03 -0500 Subject: [undertow-dev] Compile error on clean checkout In-Reply-To: <20150511212511.GB23025@fedor.yaberk.int> References: <20150511205751.GA23025@fedor.yaberk.int> <20150511212511.GB23025@fedor.yaberk.int> Message-ID: On Mon, May 11, 2015 at 4:25 PM, Ken Wills wrote: > Odd, that (1.2.x) builds for me too (mvn clean install -U). I think that artifact might > be built by the project itself. I'll take a quick look at what master builds. The -U switch apparently busted some cache entry that deleting ~/.m2/repository hadn't busted. Your command did get me through the build. Thanks! --Greg > > Ken From kwills at redhat.com Mon May 11 17:39:12 2015 From: kwills at redhat.com (Ken Wills) Date: Mon, 11 May 2015 16:39:12 -0500 Subject: [undertow-dev] Compile error on clean checkout In-Reply-To: References: <20150511205751.GA23025@fedor.yaberk.int> <20150511212511.GB23025@fedor.yaberk.int> Message-ID: <20150511213912.GC23025@fedor.yaberk.int> On Mon, May 11, 2015 at 04:30:03PM -0500, Greg Hellings wrote: > On Mon, May 11, 2015 at 4:25 PM, Ken Wills wrote: > > Odd, that (1.2.x) builds for me too (mvn clean install -U). I think that artifact might > > be built by the project itself. I'll take a quick look at what master builds. > > The -U switch apparently busted some cache entry that deleting > ~/.m2/repository hadn't busted. Your command did get me through the > build. Thanks! Great! Glad to hear it! Ken From greg.hellings at gmail.com Tue May 12 11:50:40 2015 From: greg.hellings at gmail.com (Greg Hellings) Date: Tue, 12 May 2015 10:50:40 -0500 Subject: [undertow-dev] PR Message-ID: Undertow, Yesterday I opened a pull request intended to get the javadocs:javadocs Maven target building. When I came back to my email this morning I saw that your CI process had failed on two different builds, build 1134 and 1136. When I ran the builds locally I could see no failures, but perhaps these tests are run in a slightly different environment or perhaps they are integration tests, I'm not sure. The biggest point of confusion for me stems from the fact that I can't see the test run, as the URL in the email (http://brontes.lab.eng.brq.redhat.com/viewLog.html?buildId=52974&buildTypeId=UNDERTOW_MasterWindows) does not exist and the email tells me that there is no information available except the name of which test failed. Build 1134 failed with 5 tests, while build 1136 failed with only one test. How do I rectify these bad build results if I can't see them, or are a few failures expected on those builds at present? --Greg From sdouglas at redhat.com Wed May 13 02:19:18 2015 From: sdouglas at redhat.com (Stuart Douglas) Date: Wed, 13 May 2015 16:19:18 +1000 Subject: [undertow-dev] Compile error on clean checkout In-Reply-To: References: <20150511205751.GA23025@fedor.yaberk.int> <20150511212511.GB23025@fedor.yaberk.int> Message-ID: <5552ECE6.5080902@redhat.com> Where you building with -Dmaven.test.skip=true? The build will fail if you attempt to skip tests the first time you use it using this command. This is because the Servlet tests depend on the core tests, and if tests are skipped the core test jar will not be built. This only affects the first build for a given snapshot version, after this there will be a tests jar snapshot in the local repository. If you use -DskipTests instead you will not have this problem, as the tests jar will still be built, even though the tests are not run. Stuart Greg Hellings wrote: > On Mon, May 11, 2015 at 4:25 PM, Ken Wills wrote: >> Odd, that (1.2.x) builds for me too (mvn clean install -U). I think that artifact might >> be built by the project itself. I'll take a quick look at what master builds. > > The -U switch apparently busted some cache entry that deleting > ~/.m2/repository hadn't busted. Your command did get me through the > build. Thanks! > > --Greg > >> Ken > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From epeters at epicor.com Fri May 15 18:29:12 2015 From: epeters at epicor.com (Eric Peters) Date: Fri, 15 May 2015 22:29:12 +0000 Subject: [undertow-dev] Buffers still leaking via lingering timeouts Message-ID: First, great job getting a fix in for UNDERTOW-413 very promptly. I saw that release 1.1.4-Final was finally cut, and pulled it off Maven into our dev system last night... and I'm still seeing the leak. Verified my test setup, it is on undertow-1.1.4-Final - jars for 1.1.0-Final were deleted. It may be a week before I can definitively say if it's improved at all or not, but it is definitely still leaking. I've not yet identified a trigger for the leak, so I don't have a good view on how serious it still is (that's my next task here). As the fix in undertow-1.1.4-Final didn't solve this, I fear you may need an example I don't have to provide. I'm going to need a fix soon. Ultimately I'm thinking of taking io.undertow.conduits.ReadTimeoutStreamSourceConduit.timeoutCommand, making it a named static inner class with a phantom reference to the conduit, which triggers handle.remove() when the conduit is GCd. I'm not fond of using the GC as part of a queue cleanup mechanic, but I don't know the undertow package well enough to try anything more sophisticated. Before I get to trying that, I'm open to suggestions/advice. Eric Peters Software Engineer www.epicor.com Tel.: (303) 323-8250 Fax: (512) 356-0833 E-Mail: EPeters at epicor.com [Description: Description: http://www.epicor.com/Style%20Library/Images/email/Epicoremail.gif] [Description: Description: http://www.epicor.com/Style%20Library/Images/email/sig_values3.png] This message has been scanned for malware by Websense. www.websense.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20150515/fd2ffab3/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 560 bytes Desc: image001.gif Url : http://lists.jboss.org/pipermail/undertow-dev/attachments/20150515/fd2ffab3/attachment-0001.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.png Type: image/png Size: 5818 bytes Desc: image002.png Url : http://lists.jboss.org/pipermail/undertow-dev/attachments/20150515/fd2ffab3/attachment-0001.png From sdouglas at redhat.com Sun May 17 19:56:53 2015 From: sdouglas at redhat.com (Stuart Douglas) Date: Sun, 17 May 2015 19:56:53 -0400 (EDT) Subject: [undertow-dev] Buffers still leaking via lingering timeouts In-Reply-To: References: Message-ID: <814408001.295732.1431907013048.JavaMail.zimbra@redhat.com> Can you provide some more details about what your app is doing? In particular are you using Servlet, or the native API, and are you using async IO? Stuart ----- Original Message ----- > From: "Eric Peters" > To: undertow-dev at lists.jboss.org > Sent: Saturday, 16 May, 2015 8:29:12 AM > Subject: [undertow-dev] Buffers still leaking via lingering timeouts > > > > First, great job getting a fix in for UNDERTOW-413 very promptly. > > I saw that release 1.1.4-Final was finally cut, and pulled it off Maven into > our dev system last night? and I?m still seeing the leak. > > > > Verified my test setup, it is on undertow-1.1.4-Final - jars for 1.1.0-Final > were deleted. > > > > It may be a week before I can definitively say if it?s improved at all or > not, but it is definitely still leaking. I?ve not yet identified a trigger > for the leak, so I don?t have a good view on how serious it still is (that?s > my next task here). > > > > As the fix in undertow-1.1.4-Final didn?t solve this, I fear you may need an > example I don?t have to provide. I?m going to need a fix soon. > > > > Ultimately I?m thinking of taking > io.undertow.conduits.ReadTimeoutStreamSourceConduit.timeoutCommand, making > it a named static inner class with a phantom reference to the conduit, which > triggers handle.remove() when the conduit is GCd. I?m not fond of using the > GC as part of a queue cleanup mechanic, but I don?t know the undertow > package well enough to try anything more sophisticated. > > > > Before I get to trying that, I?m open to suggestions/advice. > > > > Eric Peters > Software Engineer > www.epicor.com > Tel.: (303) 323-8250 > Fax: (512) 356-0833 > E-Mail: EPeters at epicor.com > > > > > > > > > This message has been scanned for malware by Websense. www.websense.com > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From epeters at epicor.com Mon May 18 14:13:20 2015 From: epeters at epicor.com (Eric Peters) Date: Mon, 18 May 2015 18:13:20 +0000 Subject: [undertow-dev] Buffers still leaking via lingering timeouts In-Reply-To: <814408001.295732.1431907013048.JavaMail.zimbra@redhat.com> References: <814408001.295732.1431907013048.JavaMail.zimbra@redhat.com> Message-ID: We use EJBs and servlets. The buffers for leaked connections show bits of both Ajax and Faces, but I've so far been unable to chase them back to a source (I need to go looking for a URL...). The buffers are fairly empty of helpful content - mostly tables with generated IDs I don't recognize, causing me to think they don't come from the Ajax pages that I help maintain. I'm not aware of us using any native code for JBoss, We do have a mix of modules, but not all of them are actively maintained. A quick search didn't turn up the native keyword. For Async IO, I'm familiar with it as a concept, but I also see it's a discrete module. As a concept I've never seen where we applied it to transactions, but it's at least possible it sees use. As for Async IO the module, the same answer applies. I have never seen it used, but can't vouch that we don't use it. If it helps, we migrated up from JBoss 7 with minimal changes to our configuration, primarily looking to get some of the benefits from Undertow / nio. The module I'm most concerned about would have been written largely on JBoss 7, and will likely have limited interaction with a database inside JBoss. This module makes heavy use of Servlets. //EricP -----Original Message----- From: Stuart Douglas [mailto:sdouglas at redhat.com] Sent: Sunday, May 17, 2015 5:57 PM To: Eric Peters Cc: undertow-dev at lists.jboss.org Subject: Re: [undertow-dev] Buffers still leaking via lingering timeouts Can you provide some more details about what your app is doing? In particular are you using Servlet, or the native API, and are you using async IO? Stuart ----- Original Message ----- > From: "Eric Peters" > To: undertow-dev at lists.jboss.org > Sent: Saturday, 16 May, 2015 8:29:12 AM > Subject: [undertow-dev] Buffers still leaking via lingering timeouts > > > > First, great job getting a fix in for UNDERTOW-413 very promptly. > > I saw that release 1.1.4-Final was finally cut, and pulled it off > Maven into our dev system last night? and I?m still seeing the leak. > > > > Verified my test setup, it is on undertow-1.1.4-Final - jars for > 1.1.0-Final were deleted. > > > > It may be a week before I can definitively say if it?s improved at all > or not, but it is definitely still leaking. I?ve not yet identified a > trigger for the leak, so I don?t have a good view on how serious it > still is (that?s my next task here). > > > > As the fix in undertow-1.1.4-Final didn?t solve this, I fear you may > need an example I don?t have to provide. I?m going to need a fix soon. > > > > Ultimately I?m thinking of taking > io.undertow.conduits.ReadTimeoutStreamSourceConduit.timeoutCommand, > making it a named static inner class with a phantom reference to the > conduit, which triggers handle.remove() when the conduit is GCd. I?m > not fond of using the GC as part of a queue cleanup mechanic, but I > don?t know the undertow package well enough to try anything more sophisticated. > > > > Before I get to trying that, I?m open to suggestions/advice. > > > > Eric Peters > Software Engineer > www.epicor.com > Tel.: (303) 323-8250 > Fax: (512) 356-0833 > E-Mail: EPeters at epicor.com > > > > > > > > > This message has been scanned for malware by Websense. > www.websense.com > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev Click https://www.mailcontrol.com/sr/AB3ppeXhgTbGX2PQPOmvUtXHXnVjuGgHwP!E8ROfG7PiKsRj+ko0fwGeKVAi1nvVqIuoMyLSsnSGoJj9+I0bOg== to report this email as spam. From cedric.tranxuan at motwin.com Fri May 22 04:52:36 2015 From: cedric.tranxuan at motwin.com (=?UTF-8?Q?C=C3=A9dric_Tran=2DXuan?=) Date: Fri, 22 May 2015 10:52:36 +0200 Subject: [undertow-dev] Server-Sent Event and HttpServerExchange Message-ID: Hello, We are looking at the recent support of Server-Sent Events in Undertow, which looks great! We are using the HttpServerExchange to pass data through different handlers (we do it by passing these data via setting Attachments to the HttpServerExchange). Ultimately, we need these data, to determine what to push to the client via SSE. And as we don't have access to the HttpServerExchange from the ServerSentEventConnection, we are a bit stuck. We imagine we can code some ? hack ? to do so, but first, we were wondering if ever the dev team had some insights that could help us to implement the best solution that fits the ? Undertow spirit ? and our need. Thanks in advance for your answer. Best regards, C?dric. PS: may be passing data via Attachments of HttpServerExchange is not the best practice? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20150522/155a6888/attachment.html From adiamirg at gmail.com Wed May 27 04:46:07 2015 From: adiamirg at gmail.com (adi amir) Date: Wed, 27 May 2015 11:46:07 +0300 Subject: [undertow-dev] A question about response body size limit in undertow Message-ID: Hello I'm working with undertow. I would appreciate help regarding the following issue: I have a response that have a large body size (about 1.8MB). It seems that the undertow truncates the response after 100,000~ bytes. I could not find any configuration parameter to increases this limit nor a method to overcome this issue. I would appreciate some tips on this issue. Thank you Adi Amir -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20150527/5a316a93/attachment.html From rhatlapa at redhat.com Wed May 27 10:07:04 2015 From: rhatlapa at redhat.com (Radim Hatlapatka) Date: Wed, 27 May 2015 16:07:04 +0200 Subject: [undertow-dev] A question about response body size limit in undertow In-Reply-To: References: Message-ID: <5565CF88.9020900@redhat.com> Hi Adi Amir, BTW, aren't you looking for just setting buffer size on response to make sure that all data are transmitted in one go without being chunked? If so, this could help: http://docs.oracle.com/javaee/7/api/javax/servlet/ServletResponse.html#setBufferSize%28int%29 Radim On 05/27/2015 10:46 AM, adi amir wrote: > Hello > > I'm working with undertow. > I would appreciate help regarding the following issue: > > I have a response that have a large body size (about 1.8MB). > It seems that the undertow truncates the response after 100,000~ bytes. > I could not find any configuration parameter to increases this limit nor > a method to overcome this issue. > > I would appreciate some tips on this issue. > Thank you > Adi Amir > > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20150527/076c50f3/attachment.html From jason.greene at redhat.com Wed May 27 15:07:12 2015 From: jason.greene at redhat.com (Jason Greene) Date: Wed, 27 May 2015 14:07:12 -0500 Subject: [undertow-dev] A question about response body size limit in undertow In-Reply-To: References: Message-ID: <7DA69148-F054-4141-B3F0-64EC199638BF@redhat.com> Do you have a small reproducer? We don?t have any limits out of the box. > On May 27, 2015, at 3:46 AM, adi amir wrote: > > Hello > > I'm working with undertow. > I would appreciate help regarding the following issue: > > I have a response that have a large body size (about 1.8MB). > It seems that the undertow truncates the response after 100,000~ bytes. > I could not find any configuration parameter to increases this limit nor > a method to overcome this issue. > > I would appreciate some tips on this issue. > Thank you > Adi Amir > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev -- Jason T. Greene WildFly Lead / JBoss EAP Platform Architect JBoss, a division of Red Hat From michael.hixson at gmail.com Wed May 27 21:42:50 2015 From: michael.hixson at gmail.com (Michael Hixson) Date: Wed, 27 May 2015 18:42:50 -0700 Subject: [undertow-dev] HTTP/2 with undertow-core 1.2.6.Final? Message-ID: Hello, I'm trying to test out HTTP/2 with undertow-core 1.2.6.Final. I haven't been able to see any HTTP/2 traffic to from my server locally, and I'm not sure what I'm doing wrong. I mostly followed the example code here: https://github.com/undertow-io/undertow/blob/master/examples/src/main/java/io/undertow/examples/http2/Http2Server.java Notably I: - Enable the HTTP2 and SPDY server options on my Undertow builder. - Am using an HTTPS listener with an SSLContext. - Have a maven dependency for org.mortbay.jetty.alpn:alpn-boot:8.1.3v20150130. But when I make requests in a browser (tried Chrome and Firefox), it says the protocol for all my requests is HTTP/1.1. I know at least Chrome supports HTTP2 because I can see it using HTTP2 in that very same browser console - other resources loaded by that same page on my website (e.g. to Google Analytics) are delivered *not* over HTTP/1.1. Has anyone been able to use HTTP/2 with Undertow on localhost successfully? Any ideas what I might be doing wrong? I'm using a self-signed certificate, if that matters. I also tried the keystores in the examples directory on Github and got the same result. Thinking something else in my app was interfering with this, I also tried a root HttpHandler that simply wrote "hello" to the output stream for every response. No success there either. My apologies if this is me not understanding HTTP/2 rather than any Undertow-specific thing. -Michael From jason.greene at redhat.com Wed May 27 21:54:35 2015 From: jason.greene at redhat.com (Jason T. Greene) Date: Wed, 27 May 2015 21:54:35 -0400 (EDT) Subject: [undertow-dev] HTTP/2 with undertow-core 1.2.6.Final? In-Reply-To: References: Message-ID: <61674AD8-AD4D-4D38-833F-654FDBBB0581@redhat.com> Are you using the latest Java 8 runtime? Http2 clients will reject old ciphers (Java 7) and that version of the alpn hack is only compatible with Java 8 releases after January. A self signed cert should be fine as long as you add the exception in the browser. Sent from my iPhone > On May 27, 2015, at 8:43 PM, Michael Hixson wrote: > > Hello, > > I'm trying to test out HTTP/2 with undertow-core 1.2.6.Final. I > haven't been able to see any HTTP/2 traffic to from my server locally, > and I'm not sure what I'm doing wrong. > > I mostly followed the example code here: > https://github.com/undertow-io/undertow/blob/master/examples/src/main/java/io/undertow/examples/http2/Http2Server.java > > Notably I: > - Enable the HTTP2 and SPDY server options on my Undertow builder. > - Am using an HTTPS listener with an SSLContext. > - Have a maven dependency for org.mortbay.jetty.alpn:alpn-boot:8.1.3v20150130. > > But when I make requests in a browser (tried Chrome and Firefox), it > says the protocol for all my requests is HTTP/1.1. I know at least > Chrome supports HTTP2 because I can see it using HTTP2 in that very > same browser console - other resources loaded by that same page on my > website (e.g. to Google Analytics) are delivered *not* over HTTP/1.1. > > Has anyone been able to use HTTP/2 with Undertow on localhost > successfully? Any ideas what I might be doing wrong? > > I'm using a self-signed certificate, if that matters. I also tried > the keystores in the examples directory on Github and got the same > result. Thinking something else in my app was interfering with this, > I also tried a root HttpHandler that simply wrote "hello" to the > output stream for every response. No success there either. > > My apologies if this is me not understanding HTTP/2 rather than any > Undertow-specific thing. > > -Michael > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From michael.hixson at gmail.com Wed May 27 22:21:44 2015 From: michael.hixson at gmail.com (Michael Hixson) Date: Wed, 27 May 2015 19:21:44 -0700 Subject: [undertow-dev] HTTP/2 with undertow-core 1.2.6.Final? In-Reply-To: <61674AD8-AD4D-4D38-833F-654FDBBB0581@redhat.com> References: <61674AD8-AD4D-4D38-833F-654FDBBB0581@redhat.com> Message-ID: Hi Jason, I think so. $ java -version java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode) I just remembered I also installed the JCE Unlimited Strength thing. Not sure if that would interfere. http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html I'll retry with a fresh JDK. Since you confirmed it's supposed to work, I'll also try to come up with minimal shareable code that's not working for me. -Michael On Wed, May 27, 2015 at 6:54 PM, Jason T. Greene wrote: > Are you using the latest Java 8 runtime? Http2 clients will reject old ciphers (Java 7) and that version of the alpn hack is only compatible with Java 8 releases after January. > > A self signed cert should be fine as long as you add the exception in the browser. > > Sent from my iPhone > >> On May 27, 2015, at 8:43 PM, Michael Hixson wrote: >> >> Hello, >> >> I'm trying to test out HTTP/2 with undertow-core 1.2.6.Final. I >> haven't been able to see any HTTP/2 traffic to from my server locally, >> and I'm not sure what I'm doing wrong. >> >> I mostly followed the example code here: >> https://github.com/undertow-io/undertow/blob/master/examples/src/main/java/io/undertow/examples/http2/Http2Server.java >> >> Notably I: >> - Enable the HTTP2 and SPDY server options on my Undertow builder. >> - Am using an HTTPS listener with an SSLContext. >> - Have a maven dependency for org.mortbay.jetty.alpn:alpn-boot:8.1.3v20150130. >> >> But when I make requests in a browser (tried Chrome and Firefox), it >> says the protocol for all my requests is HTTP/1.1. I know at least >> Chrome supports HTTP2 because I can see it using HTTP2 in that very >> same browser console - other resources loaded by that same page on my >> website (e.g. to Google Analytics) are delivered *not* over HTTP/1.1. >> >> Has anyone been able to use HTTP/2 with Undertow on localhost >> successfully? Any ideas what I might be doing wrong? >> >> I'm using a self-signed certificate, if that matters. I also tried >> the keystores in the examples directory on Github and got the same >> result. Thinking something else in my app was interfering with this, >> I also tried a root HttpHandler that simply wrote "hello" to the >> output stream for every response. No success there either. >> >> My apologies if this is me not understanding HTTP/2 rather than any >> Undertow-specific thing. >> >> -Michael >> _______________________________________________ >> undertow-dev mailing list >> undertow-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/undertow-dev From jason.greene at redhat.com Thu May 28 00:22:32 2015 From: jason.greene at redhat.com (Jason T. Greene) Date: Thu, 28 May 2015 00:22:32 -0400 (EDT) Subject: [undertow-dev] HTTP/2 with undertow-core 1.2.6.Final? In-Reply-To: References: <61674AD8-AD4D-4D38-833F-654FDBBB0581@redhat.com> Message-ID: Hi Michael, Could you also try running our demo directly? Instructions are on our http2 test cloud instance: http2.undertow.io > On May 27, 2015, at 9:21 PM, Michael Hixson wrote: > > Hi Jason, > > I think so. > > $ java -version > java version "1.8.0_45" > Java(TM) SE Runtime Environment (build 1.8.0_45-b14) > Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode) > > I just remembered I also installed the JCE Unlimited Strength thing. > Not sure if that would interfere. > http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html > > I'll retry with a fresh JDK. Since you confirmed it's supposed to > work, I'll also try to come up with minimal shareable code that's not > working for me. > > -Michael > > On Wed, May 27, 2015 at 6:54 PM, Jason T. Greene > wrote: >> Are you using the latest Java 8 runtime? Http2 clients will reject old ciphers (Java 7) and that version of the alpn hack is only compatible with Java 8 releases after January. >> >> A self signed cert should be fine as long as you add the exception in the browser. >> >> Sent from my iPhone >> >>> On May 27, 2015, at 8:43 PM, Michael Hixson wrote: >>> >>> Hello, >>> >>> I'm trying to test out HTTP/2 with undertow-core 1.2.6.Final. I >>> haven't been able to see any HTTP/2 traffic to from my server locally, >>> and I'm not sure what I'm doing wrong. >>> >>> I mostly followed the example code here: >>> https://github.com/undertow-io/undertow/blob/master/examples/src/main/java/io/undertow/examples/http2/Http2Server.java >>> >>> Notably I: >>> - Enable the HTTP2 and SPDY server options on my Undertow builder. >>> - Am using an HTTPS listener with an SSLContext. >>> - Have a maven dependency for org.mortbay.jetty.alpn:alpn-boot:8.1.3v20150130. >>> >>> But when I make requests in a browser (tried Chrome and Firefox), it >>> says the protocol for all my requests is HTTP/1.1. I know at least >>> Chrome supports HTTP2 because I can see it using HTTP2 in that very >>> same browser console - other resources loaded by that same page on my >>> website (e.g. to Google Analytics) are delivered *not* over HTTP/1.1. >>> >>> Has anyone been able to use HTTP/2 with Undertow on localhost >>> successfully? Any ideas what I might be doing wrong? >>> >>> I'm using a self-signed certificate, if that matters. I also tried >>> the keystores in the examples directory on Github and got the same >>> result. Thinking something else in my app was interfering with this, >>> I also tried a root HttpHandler that simply wrote "hello" to the >>> output stream for every response. No success there either. >>> >>> My apologies if this is me not understanding HTTP/2 rather than any >>> Undertow-specific thing. >>> >>> -Michael >>> _______________________________________________ >>> undertow-dev mailing list >>> undertow-dev at lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/undertow-dev From michael.hixson at gmail.com Thu May 28 01:18:47 2015 From: michael.hixson at gmail.com (Michael Hixson) Date: Wed, 27 May 2015 22:18:47 -0700 Subject: [undertow-dev] HTTP/2 with undertow-core 1.2.6.Final? In-Reply-To: References: <61674AD8-AD4D-4D38-833F-654FDBBB0581@redhat.com> Message-ID: The demo works perfectly for me locally - I see "h2" as the protocol. I copy and paste the code from Http2Server.java into my own project, run it, and I'm back to "http/1.1". There has got to be something going on in the pom's (or resource files or something) of the Undertow example that I'm not seeing. In any case I think it's pretty clear now that I'm screwing something up. I'll keep at it. -Michael On Wed, May 27, 2015 at 9:22 PM, Jason T. Greene wrote: > Hi Michael, > > Could you also try running our demo directly? > > Instructions are on our http2 test cloud instance: > http2.undertow.io > > >> On May 27, 2015, at 9:21 PM, Michael Hixson wrote: >> >> Hi Jason, >> >> I think so. >> >> $ java -version >> java version "1.8.0_45" >> Java(TM) SE Runtime Environment (build 1.8.0_45-b14) >> Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode) >> >> I just remembered I also installed the JCE Unlimited Strength thing. >> Not sure if that would interfere. >> http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html >> >> I'll retry with a fresh JDK. Since you confirmed it's supposed to >> work, I'll also try to come up with minimal shareable code that's not >> working for me. >> >> -Michael >> >> On Wed, May 27, 2015 at 6:54 PM, Jason T. Greene >> wrote: >>> Are you using the latest Java 8 runtime? Http2 clients will reject old ciphers (Java 7) and that version of the alpn hack is only compatible with Java 8 releases after January. >>> >>> A self signed cert should be fine as long as you add the exception in the browser. >>> >>> Sent from my iPhone >>> >>>> On May 27, 2015, at 8:43 PM, Michael Hixson wrote: >>>> >>>> Hello, >>>> >>>> I'm trying to test out HTTP/2 with undertow-core 1.2.6.Final. I >>>> haven't been able to see any HTTP/2 traffic to from my server locally, >>>> and I'm not sure what I'm doing wrong. >>>> >>>> I mostly followed the example code here: >>>> https://github.com/undertow-io/undertow/blob/master/examples/src/main/java/io/undertow/examples/http2/Http2Server.java >>>> >>>> Notably I: >>>> - Enable the HTTP2 and SPDY server options on my Undertow builder. >>>> - Am using an HTTPS listener with an SSLContext. >>>> - Have a maven dependency for org.mortbay.jetty.alpn:alpn-boot:8.1.3v20150130. >>>> >>>> But when I make requests in a browser (tried Chrome and Firefox), it >>>> says the protocol for all my requests is HTTP/1.1. I know at least >>>> Chrome supports HTTP2 because I can see it using HTTP2 in that very >>>> same browser console - other resources loaded by that same page on my >>>> website (e.g. to Google Analytics) are delivered *not* over HTTP/1.1. >>>> >>>> Has anyone been able to use HTTP/2 with Undertow on localhost >>>> successfully? Any ideas what I might be doing wrong? >>>> >>>> I'm using a self-signed certificate, if that matters. I also tried >>>> the keystores in the examples directory on Github and got the same >>>> result. Thinking something else in my app was interfering with this, >>>> I also tried a root HttpHandler that simply wrote "hello" to the >>>> output stream for every response. No success there either. >>>> >>>> My apologies if this is me not understanding HTTP/2 rather than any >>>> Undertow-specific thing. >>>> >>>> -Michael >>>> _______________________________________________ >>>> undertow-dev mailing list >>>> undertow-dev at lists.jboss.org >>>> https://lists.jboss.org/mailman/listinfo/undertow-dev From rhatlapa at redhat.com Thu May 28 02:17:56 2015 From: rhatlapa at redhat.com (Radim Hatlapatka) Date: Thu, 28 May 2015 08:17:56 +0200 Subject: [undertow-dev] HTTP/2 with undertow-core 1.2.6.Final? In-Reply-To: References: <61674AD8-AD4D-4D38-833F-654FDBBB0581@redhat.com> Message-ID: <5566B314.5030005@redhat.com> Hi Michael, From what I read it seems to me that you just added the alpn as dependency but not added it to -Xbootclasspath/p => there should be something like -Xbootclasspath/p:${HOME}/.m2/repository/org/mortbay/jetty/alpn/alpn-boot/8.1.3.v20150130/alpn-boot-8.1.3.v20150130.jar Hope that helps. Radim On 05/28/2015 07:18 AM, Michael Hixson wrote: > The demo works perfectly for me locally - I see "h2" as the protocol. > I copy and paste the code from Http2Server.java into my own project, > run it, and I'm back to "http/1.1". There has got to be something > going on in the pom's (or resource files or something) of the Undertow > example that I'm not seeing. > > In any case I think it's pretty clear now that I'm screwing something > up. I'll keep at it. > > -Michael > > On Wed, May 27, 2015 at 9:22 PM, Jason T. Greene > wrote: >> Hi Michael, >> >> Could you also try running our demo directly? >> >> Instructions are on our http2 test cloud instance: >> http2.undertow.io >> >> >>> On May 27, 2015, at 9:21 PM, Michael Hixson wrote: >>> >>> Hi Jason, >>> >>> I think so. >>> >>> $ java -version >>> java version "1.8.0_45" >>> Java(TM) SE Runtime Environment (build 1.8.0_45-b14) >>> Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode) >>> >>> I just remembered I also installed the JCE Unlimited Strength thing. >>> Not sure if that would interfere. >>> http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html >>> >>> I'll retry with a fresh JDK. Since you confirmed it's supposed to >>> work, I'll also try to come up with minimal shareable code that's not >>> working for me. >>> >>> -Michael >>> >>> On Wed, May 27, 2015 at 6:54 PM, Jason T. Greene >>> wrote: >>>> Are you using the latest Java 8 runtime? Http2 clients will reject old ciphers (Java 7) and that version of the alpn hack is only compatible with Java 8 releases after January. >>>> >>>> A self signed cert should be fine as long as you add the exception in the browser. >>>> >>>> Sent from my iPhone >>>> >>>>> On May 27, 2015, at 8:43 PM, Michael Hixson wrote: >>>>> >>>>> Hello, >>>>> >>>>> I'm trying to test out HTTP/2 with undertow-core 1.2.6.Final. I >>>>> haven't been able to see any HTTP/2 traffic to from my server locally, >>>>> and I'm not sure what I'm doing wrong. >>>>> >>>>> I mostly followed the example code here: >>>>> https://github.com/undertow-io/undertow/blob/master/examples/src/main/java/io/undertow/examples/http2/Http2Server.java >>>>> >>>>> Notably I: >>>>> - Enable the HTTP2 and SPDY server options on my Undertow builder. >>>>> - Am using an HTTPS listener with an SSLContext. >>>>> - Have a maven dependency for org.mortbay.jetty.alpn:alpn-boot:8.1.3v20150130. >>>>> >>>>> But when I make requests in a browser (tried Chrome and Firefox), it >>>>> says the protocol for all my requests is HTTP/1.1. I know at least >>>>> Chrome supports HTTP2 because I can see it using HTTP2 in that very >>>>> same browser console - other resources loaded by that same page on my >>>>> website (e.g. to Google Analytics) are delivered *not* over HTTP/1.1. >>>>> >>>>> Has anyone been able to use HTTP/2 with Undertow on localhost >>>>> successfully? Any ideas what I might be doing wrong? >>>>> >>>>> I'm using a self-signed certificate, if that matters. I also tried >>>>> the keystores in the examples directory on Github and got the same >>>>> result. Thinking something else in my app was interfering with this, >>>>> I also tried a root HttpHandler that simply wrote "hello" to the >>>>> output stream for every response. No success there either. >>>>> >>>>> My apologies if this is me not understanding HTTP/2 rather than any >>>>> Undertow-specific thing. >>>>> >>>>> -Michael >>>>> _______________________________________________ >>>>> undertow-dev mailing list >>>>> undertow-dev at lists.jboss.org >>>>> https://lists.jboss.org/mailman/listinfo/undertow-dev > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From michael.hixson at gmail.com Thu May 28 02:33:47 2015 From: michael.hixson at gmail.com (Michael Hixson) Date: Wed, 27 May 2015 23:33:47 -0700 Subject: [undertow-dev] HTTP/2 with undertow-core 1.2.6.Final? In-Reply-To: <5566B314.5030005@redhat.com> References: <61674AD8-AD4D-4D38-833F-654FDBBB0581@redhat.com> <5566B314.5030005@redhat.com> Message-ID: Yes, that was it. Thanks Radim! -Michael On Wed, May 27, 2015 at 11:17 PM, Radim Hatlapatka wrote: > Hi Michael, > > From what I read it seems to me that you just added the alpn as dependency > but not added it to -Xbootclasspath/p => there should be something like > -Xbootclasspath/p:${HOME}/.m2/repository/org/mortbay/jetty/alpn/alpn-boot/8.1.3.v20150130/alpn-boot-8.1.3.v20150130.jar > > Hope that helps. > > Radim > > > On 05/28/2015 07:18 AM, Michael Hixson wrote: >> >> The demo works perfectly for me locally - I see "h2" as the protocol. >> I copy and paste the code from Http2Server.java into my own project, >> run it, and I'm back to "http/1.1". There has got to be something >> going on in the pom's (or resource files or something) of the Undertow >> example that I'm not seeing. >> >> In any case I think it's pretty clear now that I'm screwing something >> up. I'll keep at it. >> >> -Michael >> >> On Wed, May 27, 2015 at 9:22 PM, Jason T. Greene >> wrote: >>> >>> Hi Michael, >>> >>> Could you also try running our demo directly? >>> >>> Instructions are on our http2 test cloud instance: >>> http2.undertow.io >>> >>> >>>> On May 27, 2015, at 9:21 PM, Michael Hixson >>>> wrote: >>>> >>>> Hi Jason, >>>> >>>> I think so. >>>> >>>> $ java -version >>>> java version "1.8.0_45" >>>> Java(TM) SE Runtime Environment (build 1.8.0_45-b14) >>>> Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode) >>>> >>>> I just remembered I also installed the JCE Unlimited Strength thing. >>>> Not sure if that would interfere. >>>> >>>> http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html >>>> >>>> I'll retry with a fresh JDK. Since you confirmed it's supposed to >>>> work, I'll also try to come up with minimal shareable code that's not >>>> working for me. >>>> >>>> -Michael >>>> >>>> On Wed, May 27, 2015 at 6:54 PM, Jason T. Greene >>>> wrote: >>>>> >>>>> Are you using the latest Java 8 runtime? Http2 clients will reject old >>>>> ciphers (Java 7) and that version of the alpn hack is only compatible with >>>>> Java 8 releases after January. >>>>> >>>>> A self signed cert should be fine as long as you add the exception in >>>>> the browser. >>>>> >>>>> Sent from my iPhone >>>>> >>>>>> On May 27, 2015, at 8:43 PM, Michael Hixson >>>>>> wrote: >>>>>> >>>>>> Hello, >>>>>> >>>>>> I'm trying to test out HTTP/2 with undertow-core 1.2.6.Final. I >>>>>> haven't been able to see any HTTP/2 traffic to from my server locally, >>>>>> and I'm not sure what I'm doing wrong. >>>>>> >>>>>> I mostly followed the example code here: >>>>>> >>>>>> https://github.com/undertow-io/undertow/blob/master/examples/src/main/java/io/undertow/examples/http2/Http2Server.java >>>>>> >>>>>> Notably I: >>>>>> - Enable the HTTP2 and SPDY server options on my Undertow builder. >>>>>> - Am using an HTTPS listener with an SSLContext. >>>>>> - Have a maven dependency for >>>>>> org.mortbay.jetty.alpn:alpn-boot:8.1.3v20150130. >>>>>> >>>>>> But when I make requests in a browser (tried Chrome and Firefox), it >>>>>> says the protocol for all my requests is HTTP/1.1. I know at least >>>>>> Chrome supports HTTP2 because I can see it using HTTP2 in that very >>>>>> same browser console - other resources loaded by that same page on my >>>>>> website (e.g. to Google Analytics) are delivered *not* over HTTP/1.1. >>>>>> >>>>>> Has anyone been able to use HTTP/2 with Undertow on localhost >>>>>> successfully? Any ideas what I might be doing wrong? >>>>>> >>>>>> I'm using a self-signed certificate, if that matters. I also tried >>>>>> the keystores in the examples directory on Github and got the same >>>>>> result. Thinking something else in my app was interfering with this, >>>>>> I also tried a root HttpHandler that simply wrote "hello" to the >>>>>> output stream for every response. No success there either. >>>>>> >>>>>> My apologies if this is me not understanding HTTP/2 rather than any >>>>>> Undertow-specific thing. >>>>>> >>>>>> -Michael >>>>>> _______________________________________________ >>>>>> undertow-dev mailing list >>>>>> undertow-dev at lists.jboss.org >>>>>> https://lists.jboss.org/mailman/listinfo/undertow-dev >> >> _______________________________________________ >> undertow-dev mailing list >> undertow-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/undertow-dev > > From michael.hixson at gmail.com Thu May 28 19:18:26 2015 From: michael.hixson at gmail.com (Michael Hixson) Date: Thu, 28 May 2015 16:18:26 -0700 Subject: [undertow-dev] http/2 server starts dying after rapid refresh Message-ID: Hello, I'm trying out HTTP/2 with undertow-core in my application, and I see that I'm able to get the server into a bad state pretty reliably by refreshing quickly in my browser. It stops responding to requests and the CPU usage of the Java process starts to climb towards 100%. I was able to replicate this in the HTTP/2 example in the latest from the master branch, by changing the main HttpHandler. This is what I put in Http2Server#main(String[]): Undertow server = Undertow.builder() .setServerOption(UndertowOptions.ENABLE_HTTP2, true) .setServerOption(UndertowOptions.ENABLE_SPDY, true) .addHttpListener(8080, bindAddress) .addHttpsListener(8443, bindAddress, sslContext) .setHandler(new HttpHandler() { @Override public void handleRequest(HttpServerExchange exchange) { if (exchange.isInIoThread()) { exchange.dispatch(this); return; } exchange.startBlocking(); exchange.getResponseHeaders().put( new HttpString("Content-Type"), "text/html"); try (BufferedWriter writer = new BufferedWriter( new OutputStreamWriter( exchange.getOutputStream(), StandardCharsets.UTF_8))) { writer.append("\n"); for (int i = 0; i < 100; i++) { writer.append( "\n"); } writer.append("hello"); } catch (IOException e) { e.printStackTrace(); throw new RuntimeException(e); } } }).build(); Then I go to https://localhost:8443/ in a browser and hold down F5 for a bit. I start seeing errors like this: java.nio.channels.ClosedChannelException at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.write(AbstractFramedStreamSinkChannel.java:396) at org.xnio.channels.Channels.writeFinalBasic(Channels.java:961) at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.writeFinal(AbstractFramedStreamSinkChannel.java:420) at org.xnio.conduits.StreamSinkChannelWrappingConduit.writeFinal(StreamSinkChannelWrappingConduit.java:66) at org.xnio.conduits.ConduitStreamSinkChannel.writeFinal(ConduitStreamSinkChannel.java:104) at io.undertow.channels.DetachableStreamSinkChannel.writeFinal(DetachableStreamSinkChannel.java:195) at io.undertow.server.HttpServerExchange$WriteDispatchChannel.writeFinal(HttpServerExchange.java:1882) at io.undertow.io.UndertowOutputStream.writeBufferBlocking(UndertowOutputStream.java:288) at io.undertow.io.UndertowOutputStream.close(UndertowOutputStream.java:331) at sun.nio.cs.StreamEncoder.implClose(StreamEncoder.java:320) at sun.nio.cs.StreamEncoder.close(StreamEncoder.java:149) at java.io.OutputStreamWriter.close(OutputStreamWriter.java:233) at java.io.BufferedWriter.close(BufferedWriter.java:266) at io.undertow.examples.http2.Http2Server$1.handleRequest(Http2Server.java:94) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) In case it helps, I saw a different error in my real (not undertow example) application when I started seeing the same effects visibly (site down and CPU climbing to 100%). Maybe it is the same root cause but just being caught/logged differently: ERROR [2015-05-28 14:23:59,804] org.xnio.nio: XNIO000011: Task io.undertow.server.protocol.framed.AbstractFramedChannel$2 at 308b5f1f failed with an exception java.lang.IllegalStateException: null at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.getBuffer(AbstractFramedStreamSinkChannel.java:523) ~[undertow-core-1.3.0.Beta1-SNAPSHOT.jar:1.3.0.Beta1-SNAPSHOT] at io.undertow.server.protocol.framed.AbstractFramedChannel.flushSenders(AbstractFramedChannel.java:496) ~[undertow-core-1.3.0.Beta1-SNAPSHOT.jar:1.3.0.Beta1-SNAPSHOT] at io.undertow.server.protocol.framed.AbstractFramedChannel$2.run(AbstractFramedChannel.java:581) ~[undertow-core-1.3.0.Beta1-SNAPSHOT.jar:1.3.0.Beta1-SNAPSHOT] at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:560) ~[xnio-nio-3.3.1.Final.jar:3.3.1.Final] at org.xnio.nio.WorkerThread.run(WorkerThread.java:462) ~[xnio-nio-3.3.1.Final.jar:3.3.1.Final] I see the same behavior in my real application with both undertow-core 1.2.6.Final and 1.3.0.Beta1-SNAPSHOT (the latter installed locally from source). I only tried the Http2Server example in the latest version though. -Michael From jason.greene at redhat.com Sat May 30 00:28:14 2015 From: jason.greene at redhat.com (Jason T. Greene) Date: Sat, 30 May 2015 00:28:14 -0400 (EDT) Subject: [undertow-dev] http/2 server starts dying after rapid refresh In-Reply-To: References: Message-ID: <4EA9BD5A-06AB-4828-ACF1-C5959EBA75BF@redhat.com> Hi Michael, That stack trace seems to show a close() call to the writer in your handler, but I don't see that call in the code? Note that getting I/o exceptions during write and close calls is normal after a client abnormally terminates. You typically just drop the exception (perhaps trace logging). Could you get a jstack output under the scenario where you see high CPU load? > On May 28, 2015, at 6:19 PM, Michael Hixson wrote: > > Hello, > > I'm trying out HTTP/2 with undertow-core in my application, and I see > that I'm able to get the server into a bad state pretty reliably by > refreshing quickly in my browser. It stops responding to requests and > the CPU usage of the Java process starts to climb towards 100%. > > I was able to replicate this in the HTTP/2 example in the latest from > the master branch, by changing the main HttpHandler. This is what I > put in Http2Server#main(String[]): > > Undertow server = Undertow.builder() > .setServerOption(UndertowOptions.ENABLE_HTTP2, true) > .setServerOption(UndertowOptions.ENABLE_SPDY, true) > .addHttpListener(8080, bindAddress) > .addHttpsListener(8443, bindAddress, sslContext) > .setHandler(new HttpHandler() { > @Override > public void handleRequest(HttpServerExchange exchange) { > if (exchange.isInIoThread()) { > exchange.dispatch(this); > return; > } > exchange.startBlocking(); > exchange.getResponseHeaders().put( > new HttpString("Content-Type"), "text/html"); > try (BufferedWriter writer = new BufferedWriter( > new OutputStreamWriter( > exchange.getOutputStream(), > StandardCharsets.UTF_8))) { > writer.append("\n"); > for (int i = 0; i < 100; i++) { > writer.append( > "\n"); > } > writer.append("hello"); > } catch (IOException e) { > e.printStackTrace(); > throw new RuntimeException(e); > } > } > }).build(); > > Then I go to https://localhost:8443/ in a browser and hold down F5 for > a bit. I start seeing errors like this: > > java.nio.channels.ClosedChannelException > at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.write(AbstractFramedStreamSinkChannel.java:396) > at org.xnio.channels.Channels.writeFinalBasic(Channels.java:961) > at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.writeFinal(AbstractFramedStreamSinkChannel.java:420) > at org.xnio.conduits.StreamSinkChannelWrappingConduit.writeFinal(StreamSinkChannelWrappingConduit.java:66) > at org.xnio.conduits.ConduitStreamSinkChannel.writeFinal(ConduitStreamSinkChannel.java:104) > at io.undertow.channels.DetachableStreamSinkChannel.writeFinal(DetachableStreamSinkChannel.java:195) > at io.undertow.server.HttpServerExchange$WriteDispatchChannel.writeFinal(HttpServerExchange.java:1882) > at io.undertow.io.UndertowOutputStream.writeBufferBlocking(UndertowOutputStream.java:288) > at io.undertow.io.UndertowOutputStream.close(UndertowOutputStream.java:331) > at sun.nio.cs.StreamEncoder.implClose(StreamEncoder.java:320) > at sun.nio.cs.StreamEncoder.close(StreamEncoder.java:149) > at java.io.OutputStreamWriter.close(OutputStreamWriter.java:233) > at java.io.BufferedWriter.close(BufferedWriter.java:266) > at io.undertow.examples.http2.Http2Server$1.handleRequest(Http2Server.java:94) > at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199) > at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774) > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) > at java.lang.Thread.run(Thread.java:745) > > In case it helps, I saw a different error in my real (not undertow > example) application when I started seeing the same effects visibly > (site down and CPU climbing to 100%). Maybe it is the same root cause > but just being caught/logged differently: > > ERROR [2015-05-28 14:23:59,804] org.xnio.nio: XNIO000011: Task > io.undertow.server.protocol.framed.AbstractFramedChannel$2 at 308b5f1f > failed with an exception > java.lang.IllegalStateException: null > at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.getBuffer(AbstractFramedStreamSinkChannel.java:523) > ~[undertow-core-1.3.0.Beta1-SNAPSHOT.jar:1.3.0.Beta1-SNAPSHOT] > at io.undertow.server.protocol.framed.AbstractFramedChannel.flushSenders(AbstractFramedChannel.java:496) > ~[undertow-core-1.3.0.Beta1-SNAPSHOT.jar:1.3.0.Beta1-SNAPSHOT] > at io.undertow.server.protocol.framed.AbstractFramedChannel$2.run(AbstractFramedChannel.java:581) > ~[undertow-core-1.3.0.Beta1-SNAPSHOT.jar:1.3.0.Beta1-SNAPSHOT] > at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:560) > ~[xnio-nio-3.3.1.Final.jar:3.3.1.Final] > at org.xnio.nio.WorkerThread.run(WorkerThread.java:462) > ~[xnio-nio-3.3.1.Final.jar:3.3.1.Final] > > I see the same behavior in my real application with both undertow-core > 1.2.6.Final and 1.3.0.Beta1-SNAPSHOT (the latter installed locally > from source). I only tried the Http2Server example in the latest > version though. > > -Michael > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From michael.hixson at gmail.com Sat May 30 01:04:57 2015 From: michael.hixson at gmail.com (Michael Hixson) Date: Fri, 29 May 2015 22:04:57 -0700 Subject: [undertow-dev] http/2 server starts dying after rapid refresh In-Reply-To: <4EA9BD5A-06AB-4828-ACF1-C5959EBA75BF@redhat.com> References: <4EA9BD5A-06AB-4828-ACF1-C5959EBA75BF@redhat.com> Message-ID: Hi Jason, I believe the close() call is coming from me declaring the writer in a try-with-resources statement. Here's a jstack from just now, where my CPU is sitting at 96%: https://gist.github.com/michaelhixson/8a6f2ebf4b167fb1b67e -Michael On Fri, May 29, 2015 at 9:28 PM, Jason T. Greene wrote: > Hi Michael, > > That stack trace seems to show a close() call to the writer in your handler, but I don't see that call in the code? > > Note that getting I/o exceptions during write and close calls is normal after a client abnormally terminates. You typically just drop the exception (perhaps trace logging). > > Could you get a jstack output under the scenario where you see high CPU load? > > >> On May 28, 2015, at 6:19 PM, Michael Hixson wrote: >> >> Hello, >> >> I'm trying out HTTP/2 with undertow-core in my application, and I see >> that I'm able to get the server into a bad state pretty reliably by >> refreshing quickly in my browser. It stops responding to requests and >> the CPU usage of the Java process starts to climb towards 100%. >> >> I was able to replicate this in the HTTP/2 example in the latest from >> the master branch, by changing the main HttpHandler. This is what I >> put in Http2Server#main(String[]): >> >> Undertow server = Undertow.builder() >> .setServerOption(UndertowOptions.ENABLE_HTTP2, true) >> .setServerOption(UndertowOptions.ENABLE_SPDY, true) >> .addHttpListener(8080, bindAddress) >> .addHttpsListener(8443, bindAddress, sslContext) >> .setHandler(new HttpHandler() { >> @Override >> public void handleRequest(HttpServerExchange exchange) { >> if (exchange.isInIoThread()) { >> exchange.dispatch(this); >> return; >> } >> exchange.startBlocking(); >> exchange.getResponseHeaders().put( >> new HttpString("Content-Type"), "text/html"); >> try (BufferedWriter writer = new BufferedWriter( >> new OutputStreamWriter( >> exchange.getOutputStream(), >> StandardCharsets.UTF_8))) { >> writer.append("\n"); >> for (int i = 0; i < 100; i++) { >> writer.append( >> "\n"); >> } >> writer.append("hello"); >> } catch (IOException e) { >> e.printStackTrace(); >> throw new RuntimeException(e); >> } >> } >> }).build(); >> >> Then I go to https://localhost:8443/ in a browser and hold down F5 for >> a bit. I start seeing errors like this: >> >> java.nio.channels.ClosedChannelException >> at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.write(AbstractFramedStreamSinkChannel.java:396) >> at org.xnio.channels.Channels.writeFinalBasic(Channels.java:961) >> at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.writeFinal(AbstractFramedStreamSinkChannel.java:420) >> at org.xnio.conduits.StreamSinkChannelWrappingConduit.writeFinal(StreamSinkChannelWrappingConduit.java:66) >> at org.xnio.conduits.ConduitStreamSinkChannel.writeFinal(ConduitStreamSinkChannel.java:104) >> at io.undertow.channels.DetachableStreamSinkChannel.writeFinal(DetachableStreamSinkChannel.java:195) >> at io.undertow.server.HttpServerExchange$WriteDispatchChannel.writeFinal(HttpServerExchange.java:1882) >> at io.undertow.io.UndertowOutputStream.writeBufferBlocking(UndertowOutputStream.java:288) >> at io.undertow.io.UndertowOutputStream.close(UndertowOutputStream.java:331) >> at sun.nio.cs.StreamEncoder.implClose(StreamEncoder.java:320) >> at sun.nio.cs.StreamEncoder.close(StreamEncoder.java:149) >> at java.io.OutputStreamWriter.close(OutputStreamWriter.java:233) >> at java.io.BufferedWriter.close(BufferedWriter.java:266) >> at io.undertow.examples.http2.Http2Server$1.handleRequest(Http2Server.java:94) >> at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199) >> at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774) >> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) >> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) >> at java.lang.Thread.run(Thread.java:745) >> >> In case it helps, I saw a different error in my real (not undertow >> example) application when I started seeing the same effects visibly >> (site down and CPU climbing to 100%). Maybe it is the same root cause >> but just being caught/logged differently: >> >> ERROR [2015-05-28 14:23:59,804] org.xnio.nio: XNIO000011: Task >> io.undertow.server.protocol.framed.AbstractFramedChannel$2 at 308b5f1f >> failed with an exception >> java.lang.IllegalStateException: null >> at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.getBuffer(AbstractFramedStreamSinkChannel.java:523) >> ~[undertow-core-1.3.0.Beta1-SNAPSHOT.jar:1.3.0.Beta1-SNAPSHOT] >> at io.undertow.server.protocol.framed.AbstractFramedChannel.flushSenders(AbstractFramedChannel.java:496) >> ~[undertow-core-1.3.0.Beta1-SNAPSHOT.jar:1.3.0.Beta1-SNAPSHOT] >> at io.undertow.server.protocol.framed.AbstractFramedChannel$2.run(AbstractFramedChannel.java:581) >> ~[undertow-core-1.3.0.Beta1-SNAPSHOT.jar:1.3.0.Beta1-SNAPSHOT] >> at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:560) >> ~[xnio-nio-3.3.1.Final.jar:3.3.1.Final] >> at org.xnio.nio.WorkerThread.run(WorkerThread.java:462) >> ~[xnio-nio-3.3.1.Final.jar:3.3.1.Final] >> >> I see the same behavior in my real application with both undertow-core >> 1.2.6.Final and 1.3.0.Beta1-SNAPSHOT (the latter installed locally >> from source). I only tried the Http2Server example in the latest >> version though. >> >> -Michael >> _______________________________________________ >> undertow-dev mailing list >> undertow-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/undertow-dev From michael.hixson at gmail.com Sat May 30 01:04:58 2015 From: michael.hixson at gmail.com (Michael Hixson) Date: Fri, 29 May 2015 22:04:58 -0700 Subject: [undertow-dev] http/2 server starts dying after rapid refresh In-Reply-To: <4EA9BD5A-06AB-4828-ACF1-C5959EBA75BF@redhat.com> References: <4EA9BD5A-06AB-4828-ACF1-C5959EBA75BF@redhat.com> Message-ID: Hi Jason, I believe the close() call is coming from me declaring the writer in a try-with-resources statement. Here's a jstack from just now, where my CPU is sitting at 96%: https://gist.github.com/michaelhixson/8a6f2ebf4b167fb1b67e -Michael On Fri, May 29, 2015 at 9:28 PM, Jason T. Greene wrote: > Hi Michael, > > That stack trace seems to show a close() call to the writer in your handler, but I don't see that call in the code? > > Note that getting I/o exceptions during write and close calls is normal after a client abnormally terminates. You typically just drop the exception (perhaps trace logging). > > Could you get a jstack output under the scenario where you see high CPU load? > > >> On May 28, 2015, at 6:19 PM, Michael Hixson wrote: >> >> Hello, >> >> I'm trying out HTTP/2 with undertow-core in my application, and I see >> that I'm able to get the server into a bad state pretty reliably by >> refreshing quickly in my browser. It stops responding to requests and >> the CPU usage of the Java process starts to climb towards 100%. >> >> I was able to replicate this in the HTTP/2 example in the latest from >> the master branch, by changing the main HttpHandler. This is what I >> put in Http2Server#main(String[]): >> >> Undertow server = Undertow.builder() >> .setServerOption(UndertowOptions.ENABLE_HTTP2, true) >> .setServerOption(UndertowOptions.ENABLE_SPDY, true) >> .addHttpListener(8080, bindAddress) >> .addHttpsListener(8443, bindAddress, sslContext) >> .setHandler(new HttpHandler() { >> @Override >> public void handleRequest(HttpServerExchange exchange) { >> if (exchange.isInIoThread()) { >> exchange.dispatch(this); >> return; >> } >> exchange.startBlocking(); >> exchange.getResponseHeaders().put( >> new HttpString("Content-Type"), "text/html"); >> try (BufferedWriter writer = new BufferedWriter( >> new OutputStreamWriter( >> exchange.getOutputStream(), >> StandardCharsets.UTF_8))) { >> writer.append("\n"); >> for (int i = 0; i < 100; i++) { >> writer.append( >> "\n"); >> } >> writer.append("hello"); >> } catch (IOException e) { >> e.printStackTrace(); >> throw new RuntimeException(e); >> } >> } >> }).build(); >> >> Then I go to https://localhost:8443/ in a browser and hold down F5 for >> a bit. I start seeing errors like this: >> >> java.nio.channels.ClosedChannelException >> at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.write(AbstractFramedStreamSinkChannel.java:396) >> at org.xnio.channels.Channels.writeFinalBasic(Channels.java:961) >> at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.writeFinal(AbstractFramedStreamSinkChannel.java:420) >> at org.xnio.conduits.StreamSinkChannelWrappingConduit.writeFinal(StreamSinkChannelWrappingConduit.java:66) >> at org.xnio.conduits.ConduitStreamSinkChannel.writeFinal(ConduitStreamSinkChannel.java:104) >> at io.undertow.channels.DetachableStreamSinkChannel.writeFinal(DetachableStreamSinkChannel.java:195) >> at io.undertow.server.HttpServerExchange$WriteDispatchChannel.writeFinal(HttpServerExchange.java:1882) >> at io.undertow.io.UndertowOutputStream.writeBufferBlocking(UndertowOutputStream.java:288) >> at io.undertow.io.UndertowOutputStream.close(UndertowOutputStream.java:331) >> at sun.nio.cs.StreamEncoder.implClose(StreamEncoder.java:320) >> at sun.nio.cs.StreamEncoder.close(StreamEncoder.java:149) >> at java.io.OutputStreamWriter.close(OutputStreamWriter.java:233) >> at java.io.BufferedWriter.close(BufferedWriter.java:266) >> at io.undertow.examples.http2.Http2Server$1.handleRequest(Http2Server.java:94) >> at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199) >> at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774) >> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) >> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) >> at java.lang.Thread.run(Thread.java:745) >> >> In case it helps, I saw a different error in my real (not undertow >> example) application when I started seeing the same effects visibly >> (site down and CPU climbing to 100%). Maybe it is the same root cause >> but just being caught/logged differently: >> >> ERROR [2015-05-28 14:23:59,804] org.xnio.nio: XNIO000011: Task >> io.undertow.server.protocol.framed.AbstractFramedChannel$2 at 308b5f1f >> failed with an exception >> java.lang.IllegalStateException: null >> at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.getBuffer(AbstractFramedStreamSinkChannel.java:523) >> ~[undertow-core-1.3.0.Beta1-SNAPSHOT.jar:1.3.0.Beta1-SNAPSHOT] >> at io.undertow.server.protocol.framed.AbstractFramedChannel.flushSenders(AbstractFramedChannel.java:496) >> ~[undertow-core-1.3.0.Beta1-SNAPSHOT.jar:1.3.0.Beta1-SNAPSHOT] >> at io.undertow.server.protocol.framed.AbstractFramedChannel$2.run(AbstractFramedChannel.java:581) >> ~[undertow-core-1.3.0.Beta1-SNAPSHOT.jar:1.3.0.Beta1-SNAPSHOT] >> at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:560) >> ~[xnio-nio-3.3.1.Final.jar:3.3.1.Final] >> at org.xnio.nio.WorkerThread.run(WorkerThread.java:462) >> ~[xnio-nio-3.3.1.Final.jar:3.3.1.Final] >> >> I see the same behavior in my real application with both undertow-core >> 1.2.6.Final and 1.3.0.Beta1-SNAPSHOT (the latter installed locally >> from source). I only tried the Http2Server example in the latest >> version though. >> >> -Michael >> _______________________________________________ >> undertow-dev mailing list >> undertow-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/undertow-dev From michael.hixson at gmail.com Sat May 30 01:26:02 2015 From: michael.hixson at gmail.com (Michael Hixson) Date: Fri, 29 May 2015 22:26:02 -0700 Subject: [undertow-dev] http/2 server starts dying after rapid refresh In-Reply-To: References: <4EA9BD5A-06AB-4828-ACF1-C5959EBA75BF@redhat.com> Message-ID: Also here is a jmap -histo from a little later: https://gist.github.com/michaelhixson/de6ede25fdb79a4f25b4 (apologies in advance if gmail sends this email twice like my last one) -Michael On Fri, May 29, 2015 at 10:04 PM, Michael Hixson wrote: > Hi Jason, > > I believe the close() call is coming from me declaring the writer in a > try-with-resources statement. > > Here's a jstack from just now, where my CPU is sitting at 96%: > https://gist.github.com/michaelhixson/8a6f2ebf4b167fb1b67e > > -Michael > > On Fri, May 29, 2015 at 9:28 PM, Jason T. Greene > wrote: >> Hi Michael, >> >> That stack trace seems to show a close() call to the writer in your handler, but I don't see that call in the code? >> >> Note that getting I/o exceptions during write and close calls is normal after a client abnormally terminates. You typically just drop the exception (perhaps trace logging). >> >> Could you get a jstack output under the scenario where you see high CPU load? >> >> >>> On May 28, 2015, at 6:19 PM, Michael Hixson wrote: >>> >>> Hello, >>> >>> I'm trying out HTTP/2 with undertow-core in my application, and I see >>> that I'm able to get the server into a bad state pretty reliably by >>> refreshing quickly in my browser. It stops responding to requests and >>> the CPU usage of the Java process starts to climb towards 100%. >>> >>> I was able to replicate this in the HTTP/2 example in the latest from >>> the master branch, by changing the main HttpHandler. This is what I >>> put in Http2Server#main(String[]): >>> >>> Undertow server = Undertow.builder() >>> .setServerOption(UndertowOptions.ENABLE_HTTP2, true) >>> .setServerOption(UndertowOptions.ENABLE_SPDY, true) >>> .addHttpListener(8080, bindAddress) >>> .addHttpsListener(8443, bindAddress, sslContext) >>> .setHandler(new HttpHandler() { >>> @Override >>> public void handleRequest(HttpServerExchange exchange) { >>> if (exchange.isInIoThread()) { >>> exchange.dispatch(this); >>> return; >>> } >>> exchange.startBlocking(); >>> exchange.getResponseHeaders().put( >>> new HttpString("Content-Type"), "text/html"); >>> try (BufferedWriter writer = new BufferedWriter( >>> new OutputStreamWriter( >>> exchange.getOutputStream(), >>> StandardCharsets.UTF_8))) { >>> writer.append("\n"); >>> for (int i = 0; i < 100; i++) { >>> writer.append( >>> "\n"); >>> } >>> writer.append("hello"); >>> } catch (IOException e) { >>> e.printStackTrace(); >>> throw new RuntimeException(e); >>> } >>> } >>> }).build(); >>> >>> Then I go to https://localhost:8443/ in a browser and hold down F5 for >>> a bit. I start seeing errors like this: >>> >>> java.nio.channels.ClosedChannelException >>> at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.write(AbstractFramedStreamSinkChannel.java:396) >>> at org.xnio.channels.Channels.writeFinalBasic(Channels.java:961) >>> at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.writeFinal(AbstractFramedStreamSinkChannel.java:420) >>> at org.xnio.conduits.StreamSinkChannelWrappingConduit.writeFinal(StreamSinkChannelWrappingConduit.java:66) >>> at org.xnio.conduits.ConduitStreamSinkChannel.writeFinal(ConduitStreamSinkChannel.java:104) >>> at io.undertow.channels.DetachableStreamSinkChannel.writeFinal(DetachableStreamSinkChannel.java:195) >>> at io.undertow.server.HttpServerExchange$WriteDispatchChannel.writeFinal(HttpServerExchange.java:1882) >>> at io.undertow.io.UndertowOutputStream.writeBufferBlocking(UndertowOutputStream.java:288) >>> at io.undertow.io.UndertowOutputStream.close(UndertowOutputStream.java:331) >>> at sun.nio.cs.StreamEncoder.implClose(StreamEncoder.java:320) >>> at sun.nio.cs.StreamEncoder.close(StreamEncoder.java:149) >>> at java.io.OutputStreamWriter.close(OutputStreamWriter.java:233) >>> at java.io.BufferedWriter.close(BufferedWriter.java:266) >>> at io.undertow.examples.http2.Http2Server$1.handleRequest(Http2Server.java:94) >>> at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199) >>> at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774) >>> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) >>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) >>> at java.lang.Thread.run(Thread.java:745) >>> >>> In case it helps, I saw a different error in my real (not undertow >>> example) application when I started seeing the same effects visibly >>> (site down and CPU climbing to 100%). Maybe it is the same root cause >>> but just being caught/logged differently: >>> >>> ERROR [2015-05-28 14:23:59,804] org.xnio.nio: XNIO000011: Task >>> io.undertow.server.protocol.framed.AbstractFramedChannel$2 at 308b5f1f >>> failed with an exception >>> java.lang.IllegalStateException: null >>> at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.getBuffer(AbstractFramedStreamSinkChannel.java:523) >>> ~[undertow-core-1.3.0.Beta1-SNAPSHOT.jar:1.3.0.Beta1-SNAPSHOT] >>> at io.undertow.server.protocol.framed.AbstractFramedChannel.flushSenders(AbstractFramedChannel.java:496) >>> ~[undertow-core-1.3.0.Beta1-SNAPSHOT.jar:1.3.0.Beta1-SNAPSHOT] >>> at io.undertow.server.protocol.framed.AbstractFramedChannel$2.run(AbstractFramedChannel.java:581) >>> ~[undertow-core-1.3.0.Beta1-SNAPSHOT.jar:1.3.0.Beta1-SNAPSHOT] >>> at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:560) >>> ~[xnio-nio-3.3.1.Final.jar:3.3.1.Final] >>> at org.xnio.nio.WorkerThread.run(WorkerThread.java:462) >>> ~[xnio-nio-3.3.1.Final.jar:3.3.1.Final] >>> >>> I see the same behavior in my real application with both undertow-core >>> 1.2.6.Final and 1.3.0.Beta1-SNAPSHOT (the latter installed locally >>> from source). I only tried the Http2Server example in the latest >>> version though. >>> >>> -Michael >>> _______________________________________________ >>> undertow-dev mailing list >>> undertow-dev at lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/undertow-dev From ralf.battenfeld at bluewin.ch Sat May 9 07:23:51 2015 From: ralf.battenfeld at bluewin.ch (ralf.battenfeld at bluewin.ch) Date: Sat, 09 May 2015 11:23:51 -0000 Subject: [undertow-dev] Changing proxy response Message-ID: <9705223.10163.1431170628777.JavaMail.webmail@bluewin.ch> Hi I am looking for a way to use the LoadBalancingProxyClient that changes the response received from the backend server. I came up with configuring a ResponseCommitListener. Is this the correct way of manipulating the response within the beforeCommit() call? If yes, how can I change the response with the given HttpServerExchange instance? If not, what would be the best way to achieve this? Thanks a lot for any help. Ralf -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20150509/53d9f8f7/attachment.html