[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jetty-users] proxy AsyncMiddleManServlet: ProxyWriter onWritePossible never called
|
> On Oct 2, 2017, at 3:17 PM, Steven Schlansker <stevenschlansker@xxxxxxxxx> wrote:
>
> Hello again jetty-users,
>
> I'm converting the bespoke proxy service I inherited to use jetty-proxy's provided AsyncMiddleManServlet
> and am encountering an unfortunate hang that I'm not sure how to diagnose.
> ...
> * I've somehow prevented a necessary callback from getting invoked that would have later triggered an onWritePossible
I figured it out! There were two problems -- first, overriding 'onProxyResponseSuccess' will inhibit calling
asyncContext.complete(); you need to make sure to call 'super.onProxyResponseSuccess' or do it yourself.
Additionally, the test harness code was calling get() on the Future I return out of the proxy -- blocking
the server thread and preventing the onWritePossible getting called. So I moved my tester code out of the
Jetty thread into its own.
Seems to work well now. Hopefully this note helps someone save some time in the future :)
Attachment:
signature.asc
Description: Message signed with OpenPGP using GPGMail