Fixing race condition in HTTP/2 test

Motivation:

InboundHttp2ToHttpAdapterTest swaps non-volatile CountDownLatches in
handlers, which seems to cause a race condition that can lead to missing
messages.

Modifications:

Make CountDownLatch variables in InboundHttp2ToHttpAdapterTest volatile.

Result:

InboundHttp2ToHttpAdapterTest should be more stable.
This commit is contained in:
nmittler 2014-10-09 15:26:25 -07:00 committed by Norman Maurer
parent 74e72ea752
commit ad259a456e

View File

@ -699,7 +699,7 @@ public class InboundHttp2ToHttpAdapterTest {
private final class HttpResponseDelegator extends SimpleChannelInboundHandler<HttpObject> {
private final HttpResponseListener listener;
private CountDownLatch latch;
private volatile CountDownLatch latch;
public HttpResponseDelegator(HttpResponseListener listener, CountDownLatch latch) {
super(false);