Undertow proxy handler + RequestLimit handler issue
by paroczizs
Hi Undertow Dev,
we built a custom integration component based on Wildfly 11 with Undertow
1.4.18. The application contains a couple of custom and built in handlers.
We found the following:
There is a RequestLimit handler right at the beginning and finally the
proxy handler. When the backend getting to be slow and the load is
relatively high the RequestLimit handler does its job queues the request
then throws the request above the queue. When the proxy times out it starts
to consume the queue, in some cases the exception below occurs and we found
that in this case the counter in the RequestLimit handler is not reduced
and the it can stuck the way to the backend.
Are there any possibility to handle the exception in a custom handler?
Thank you in advance, Zsolt
2018-11-28 12:02:19,518 ERROR [io.undertow.proxy] (default I/O-2) UT005028:
Proxy request to /lwi/optinus/getentityanswersservice failed:
java.nio.channels.ClosedChannelException
at
io.undertow.client.http.HttpClientConnection$5.handleEvent(HttpClientConnection.java:194)
at
io.undertow.client.http.HttpClientConnection$5.handleEvent(HttpClientConnection.java:173)
at
org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
at
org.xnio.StreamConnection.invokeCloseListener(StreamConnection.java:80)
at org.xnio.Connection.close(Connection.java:142)
at org.xnio.IoUtils.safeClose(IoUtils.java:152)
at io.undertow.util.ConnectionUtils$3.run(ConnectionUtils.java:102)
at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:612)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:479)
6 months, 2 weeks
Creating a websocket proxy with undertow
by Marc Boorshtein
Using the 1.4 series, I'm trying to handle upgrade and websockets. Looking
at a few examples and the code I think what I need to do is:
1. add the WebSocketServlet to the right path
2. implement WebSocketConnectionCallback that will call my remote ws://
server
Am I on the right track? I haven't found an example of doing this with
undertow but found something similar with jetty (
https://github.com/chipster/chipster-web-server/blob/master/src/main/java...)
but I havne't found the same thing for undertow so any pointers would be
appreciated.
Thanks
Marc Boorshtein
7 months, 2 weeks
Issue with Undertow Client and SSL
by Thomas Segismont
Hi,
Openshift Origin uses Hawkular Metrics to store node and container data. In
this scenario, Hawkular Metrics calls the Kubernetes master server over
HTTPS to validate the client identity. This is implemented with Undertow
Client, as part of a ServletExtension (inside Wildfly 10) [1]. Works fine
in development and testing.
Now the Openshit team sees errors in the logs [2][3]. I couldn't reproduce
yet. Errors come in pair, first the "UT005001: An exception occurred
processing the request: java.lang.IllegalStateException: XNIO000017: Buffer
was already freed", and just after "XNIO001007: A channel event listener
threw an exception: java.lang.NullPointerException".
Does that ring a bell? I haven't been able to find a starting point by
looking into the source the code.
Thanks
--
Thomas Segismont
JBoss ON Engineering Team
[1] https://git.io/vrNyP
[2] https://issues.jboss.org/browse/HWKMETRICS-408
[3] https://issues.jboss.org/secure/attachment/12405779/hawkular.log
8 months, 2 weeks
Correctly shutting down a websocket handler
by Robin Anil
When a client disconnects, I see that onClose is not being fired. The only
way this seems to be firing if client sents a close frame.
Is there any way to detect disconnection and immediately close all the
opened resources.
Robin
Robin Anil | Software Engineer
3 years, 1 month
[undertow-dev] Unexpected authentication attempt
by Stefan Moebius
Hi,
Not sure if this the right place to raise this question, but I'm having a problem with Undertow in Wildfly 10. It attempts to do an authentication on a URL which is not configured for any authentication. Even worse, it doesn't do that consistently. The log of the request processing looks something like this:
[io.undertow.request] Matched default handler path /base/servlet
[io.undertow.request] Matched prefix path /base/servlet for path /base/servlet
[io.undertow.request.security] Security constraints for request /base/servlet are [SingleConstraintMatch{emptyRoleSemantic=PERMIT, requiredRoles=[]}]
[io.undertow.request.security] Attempting to authenticate HttpServerExchange{
GET /base/servlet request {
Accept=[text/xml, application/xml, application/xhtml+xml, text/html;q=0.9, text/plain;q=0.8, text/css, image/png, image/jpeg, image/gif;q=0.8, application/x-shockwave-flash, video/mp4;q=0.9, flv-application/octet-stream;q=0.8, video/x-flv;q=0.7, audio/mp4, application/futuresplash, */*;q=0.5, application/x-mpegURL],
Connection=[Keep-Alive],
Accept-Encoding=[gzip,deflate],
x-flash-version=[33,1,1,190],
Referer=[app:/MyApp.swf],
User-Agent=[Mozilla/5.0 (Windows; U; en-US) AppleWebKit/533.19.4 (KHTML, like Gecko) AdobeAIR/33.1],
Host=[host.com]}
response {
Cache-Control=[no-cache],
X-Powered-By=[Undertow/1],
Server=[WildFly/10]}},
authentication required: false
[io.undertow.request.security] Authentication outcome was NOT_ATTEMPTED with method io.undertow.security.impl.CachedAuthenticatedSessionMechanism@33c03535 for HttpServerExchange{ GET /base/servlet request {Accept=[text/xml, application/xml, application/xhtml+xml, text/html;q=0.9, text/plain;q=0.8, text/css, image/png, image/jpeg, image/gif;q=0.8, application/x-shockwave-flash, video/mp4;q=0.9, flv-application/octet-stream;q=0.8, video/x-flv;q=0.7, audio/mp4, application/futuresplash, */*;q=0.5, application/x-mpegURL], Connection=[Keep-Alive], Accept-Encoding=[gzip,deflate], x-flash-version=[33,1,1,190], Referer=[app:/MyApp.swf], User-Agent=[Mozilla/5.0 (Windows; U; en-US) AppleWebKit/533.19.4 (KHTML, like Gecko) AdobeAIR/33.1], Host=[host.com]} response {Cache-Control=[no-cache], X-Powered-By=[Undertow/1], Server=[WildFly/10]}}
[com.vendor.MyAuthenticationMechanism] Logging from my authentication mechanism, which isn't supposed to apply to /base/servlet, but to /base/
[io.undertow.request.security] Authentication outcome was NOT_AUTHENTICATED with method com.vendor.MyAuthenticationMechanism@2b9a1c7 for HttpServerExchange{ GET /base/servlet request {Accept=[text/xml, application/xml, application/xhtml+xml, text/html;q=0.9, text/plain;q=0.8, text/css, image/png, image/jpeg, image/gif;q=0.8, application/x-shockwave-flash, video/mp4;q=0.9, flv-application/octet-stream;q=0.8, video/x-flv;q=0.7, audio/mp4, application/futuresplash, */*;q=0.5, application/x-mpegURL], Connection=[Keep-Alive], Accept-Encoding=[gzip,deflate], x-flash-version=[33,1,1,190], Referer=[app:/MyApp.swf], User-Agent=[Mozilla/5.0 (Windows; U; en-US) AppleWebKit/533.19.4 (KHTML, like Gecko) AdobeAIR/33.1], Host=[host.com]} response {Connection=[keep-alive], Cache-Control=[no-cache], X-Powered-By=[Undertow/1], Server=[WildFly/10], Location=[https://redirect.me], Content-Length=[0], Date=[Tue, 01 Dec 2020 16:36:36 GMT]}}
[io.undertow.request.security] Sending authentication challenge for HttpServerExchange{ GET /base/servlet request {Accept=[text/xml, application/xml, application/xhtml+xml, text/html;q=0.9, text/plain;q=0.8, text/css, image/png, image/jpeg, image/gif;q=0.8, application/x-shockwave-flash, video/mp4;q=0.9, flv-application/octet-stream;q=0.8, video/x-flv;q=0.7, audio/mp4, application/futuresplash, */*;q=0.5, application/x-mpegURL], Connection=[Keep-Alive], Accept-Encoding=[gzip,deflate], x-flash-version=[33,1,1,190], Referer=[app:/MyApp.swf], User-Agent=[Mozilla/5.0 (Windows; U; en-US) AppleWebKit/533.19.4 (KHTML, like Gecko) AdobeAIR/33.1], Host=[host.com]} response {Connection=[keep-alive], Cache-Control=[no-cache], X-Powered-By=[Undertow/1], Server=[WildFly/10], Location=[https://redirect.me], Content-Length=[0], Date=[Tue, 01 Dec 2020 16:36:36 GMT]}}
[io.undertow.request.security] Authentication result was CHALLENGE_SENT for HttpServerExchange{ GET /base/servlet request {Accept=[text/xml, application/xml, application/xhtml+xml, text/html;q=0.9, text/plain;q=0.8, text/css, image/png, image/jpeg, image/gif;q=0.8, application/x-shockwave-flash, video/mp4;q=0.9, flv-application/octet-stream;q=0.8, video/x-flv;q=0.7, audio/mp4, application/futuresplash, */*;q=0.5, application/x-mpegURL], Connection=[Keep-Alive], Accept-Encoding=[gzip,deflate], x-flash-version=[33,1,1,190], Referer=[app:/MyApp.swf], User-Agent=[Mozilla/5.0 (Windows; U; en-US) AppleWebKit/533.19.4 (KHTML, like Gecko) AdobeAIR/33.1], Host=[host.com]} response {Connection=[keep-alive], Cache-Control=[no-cache], X-Powered-By=[Undertow/1], Server=[WildFly/10], Location=[https://redirect.me], Content-Length=[0], Date=[Tue, 01 Dec 2020 16:36:36 GMT]}}
As you can see, it even says "authentication required: false" on the HttpServerExchange.
An equivalent request at a different time went through without authentication, as expected.
Any ideas on what might be going on here, or where to look for further diagnosis?
Regards,
Stefan
5 years, 11 months