users@grizzly.java.net

NPE's at low concurrency using AsyncHttpClient

From: Daniel Feist <dfeist_at_gmail.com>
Date: Fri, 13 Feb 2015 15:35:15 +0000

Hi Alexey,

We're geting a weird issue when using AHC/Grizzly for outbound HTTP
POST operations. When testing using POST and giving AHC an
InputStream to send, we get a significant number of NPE's occuring (1
to 5% of requests), even at just 10 client threads. I havn't been
able to reproduce this locally yet, but it happens consistently on our
test enviroment.

I'm not sure how to get to the bottom of this (am in the middle of
trying) but given your much deeper knowledge of the codebase maybe you
have some insights/ideas. With a single client thread there are no
issues so it look like it may be some kind of race condition. Also
passing a String to AHC or turn off chunking such that
com.ning.http.client.generators.InputStreamBodyGenerator doesn't get
used, there are no NPE's either.

Dan

-----

This is the error seen:

WARN 2015-02-13 09:06:38,336
[[http_module_proxy].proxyConfig.worker.10]
org.glassfish.grizzly.filterchain.DefaultFilterChain: GRIZZLY0013:
Exception during FilterChain execution
java.lang.NullPointerException
    at com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider$AsyncHttpClientEventFilter.onHttpContentEncoded(GrizzlyAsyncHttpProvider.java:1243)
~[?:?]
    at org.glassfish.grizzly.http.HttpCodecFilter.encodeHttpPacket(HttpCodecFilter.java:1463)
~[?:?]
    at org.glassfish.grizzly.http.HttpClientFilter.encodeHttpPacket(HttpClientFilter.java:283)
~[?:?]