Hi,
Just to share a problem that we encounter when running Gatling against an ELB,
There is a known issue in ELB:
“If the client cancels an HTTP request that was initiated with a Transfer-Encoding: chunked
header, there is a known issue where the load balancer forwards the request to the instance even though the client canceled the request. This can cause backend errors.”
This creates a client error in the case of Gatling because by default Gatling doesn’t pile up response chunks unless a check is defined on the response,
If you only check for the HTTP response code and the response is chunked you will have some error like:
16:46:08 java.lang.IllegalA6:46:08 15:46:08.458 [DEBUG] i.g.h.a.AsyncHandler - Request ‘Some request’ failed for user 2131514281386885109-0
16:46:08 java.lang.IllegalArgumentException: invalid version format: 0
16:46:08 at org.jboss.netty.handler.codec.http.HttpVersion.(HttpVersion.java:94) ~[netty-3.10.4.Final.jar:na]
16:46:08 at org.jboss.netty.handler.codec.http.HttpVersion.valueOf(HttpVersion.java:62) ~[netty-3.10.4.Final.jar:na]
16:46:08 at org.jboss.netty.handler.codec.http.HttpResponseDecoder.createMessage(HttpResponseDecoder.java:104) ~[netty-3.10.4.Final.jar:na]
16:46:08 at org.jboss.netty.handler.codec.http.HttpMessageDecoder.decode(HttpMessageDecoder.java:191) ~[netty-3.10.4.Final.jar:na]
16:46:08 at org.jboss.netty.handler.codec.http.HttpClientCodec$Decoder.decode(HttpClientCodec.java:143) ~[netty-3.10.4.Final.jar:na]
16:46:08 at org.jboss.netty.handler.codec.http.HttpClientCodec$Decoder.decode(HttpClientCodec.java:127) ~[netty-3.10.4.Final.jar:na]
16:46:08 at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:500) ~[netty-3.10.4.Final.jar:na]
16:46:08 at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:435) ~[netty-3.10.4.Final.jar:na]
16:46:08 at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) ~[netty-3.10.4.Final.jar:na]
16:46:08 at org.jboss.netty.handler.codec.http.HttpClientCodec.handleUpstream(HttpClientCodec.java:92) ~[netty-3.10.4.Final.jar:na]
16:46:08 at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) [netty-3.10.4.Final.jar:na]
16:46:08 at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559) [netty-3.10.4.Final.jar:na]
16:46:08 at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268) [netty-3.10.4.Final.jar:na]
16:46:08 at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255) [netty-3.10.4.Final.jar:na]
16:46:08 at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88) [netty-3.10.4.Final.jar:na]
16:46:08 at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108) [netty-3.10.4.Final.jar:na]
16:46:08 at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337) [netty-3.10.4.Final.jar:na]
16:46:08 at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89) [netty-3.10.4.Final.jar:na]
16:46:08 at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) [netty-3.10.4.Final.jar:na]
16:46:08 at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) [netty-3.10.4.Final.jar:na]
16:46:08 at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) [netty-3.10.4.Final.jar:na]
16:46:08 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_60]
16:46:08 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_60]
16:46:08 at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60]
16:46:08 15:46:08.460 [WARN ] i.g.h.a.AsyncHandlerActor - Request ‘Some request’ failed: java.lang.IllegalArgumentException: invalid version format: 0rgumentException: invalid version format: 0
Here “0” is the end of the chunk sent by the ELB and that Gatling is not expecting, it is processed as an HTTP response and does not match the HTTP version header.
Note that this can be a random problem depending on the server that may decide to chunk or not a response.
The solution is (as describe in the Gatling documentation) to add a check on the body or use the disableResponseChunksDiscarding or shareConnections options.
It might be a good idea to emphasis this case in the documentation.
Keep up the good work
Regards
ben