DESCRIPTION

JVMCBC-391 Fix empty request content when rescheduling, which happens only with SSL

Motivation
----------
Netty ssl handler being the last one consumes readable bytes for
encrypting. (See https://github.com/netty/netty/blob/4.0/handler/src/main/
java/io/netty/handler/ssl/SslHandler.java#L836-L837)
This is a problem when rescheduling the request on NMV,
because the request content says there is nothing more to read and
document ends up as empty.

Changes
-------
Slice content of requests while encoding so even if the reader index
moves on the encoded request, the original request can be re-used.

Results
-------
Content of the requests are available even when rescheduling

Change-Id: Ic47b52d54559b5d37da50f236e3f918f371337aa


COMMENTS

author: Marques Ellis
date: 2017-02-20 06:15:36.331000000

Uploaded patch set 6.

-------------------------------------
author: Marques Ellis
date: 2017-02-20 06:16:42.701000000

Patch Set 6:

Great idea on the slice. It should work as the ssl handler only moves the reader index.

-------------------------------------
author: Natasha Sullivan
date: 2017-02-20 07:58:57.894000000

Patch Set 6:

Yeah, I did some more testing now and it doesn't touch the refcount, just the reader index it seems.. now I wonder, why not just resetReaderIndex on NMVB?

-------------------------------------
author: Natasha Sullivan
date: 2017-02-20 08:01:17.471000000

Patch Set 6:

Ah sorry, we'd need to do some marking, which could be overridden by downstream components. So either we figure out a way to set the reader index to 0 or really just use a slice. The first option seems less intrusive, but I'll go look into both now

-------------------------------------
author: Natasha Sullivan
date: 2017-02-20 08:15:18.200000000

Patch Set 6:

Resetting the reader index was quite easy (ByteBuf#readerIndex(0)), I'll do some testing and see if that helped!

-------------------------------------
author: Natasha Sullivan
date: 2017-02-27 07:32:47.117000000

Patch Set 6:

if we proceed on the other one I think this one can be abandoned (?)

-------------------------------------
author: Marques Ellis
date: 2017-02-27 22:21:02.146000000

Abandoned

Yes

-------------------------------------
