2016-12-14 10:07 GMT+01:00 Mark Thomas <ma...@apache.org>:

> On 14/12/2016 08:54, Rémy Maucherat wrote:
> > 2016-12-14 9:50 GMT+01:00 Mark Thomas <ma...@apache.org>:
> >
> >> The failure happens on current trunk too so I don't think this is
> >> related to the refactoring. However, I am going to investigate this
> >> failure first - before I apply the refactoring.
> >>
> >> What is the intermittent failure ?
> > https://ci.apache.org/builders/tomcat-trunk seems happy (usually it's
> not).
>
> TestHttp11Processor.test57621b
>
> Fails maybe 1 time in 10. It looks like something is going wrong
> resetting the input buffer between requests.
>
> Ah this test is very specific. The runnable is doing what a dispatch would
do but it doesn't have the code to wait until the container thread has
returned:

    public synchronized boolean asyncDispatch() {
        if (!ContainerThreadMarker.isContainerThread() && state ==
AsyncState.STARTING) {
            state = AsyncState.DISPATCH_PENDING;
            return false;
        } else {
            return doDispatch();
        }
    }

vs:

    public synchronized void asyncRun(Runnable runnable) {
... [set env]
                processor.getExecutor().execute(runnable);
 ... [unset env]
    }

So if this is allowed, it would run into the same concurrency issues that
were fixed for dispatch.

Rémy

Reply via email to