synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Asankha C. Perera" <asan...@wso2.com>
Subject Connection closes and SharedInputBuffer shutdown
Date Fri, 29 Aug 2008 12:44:55 GMT
Hi Oleg

I am looking at the SharedInputBuffer, for which Jason has proposed some 
fixes (https://issues.apache.org/jira/browse/HTTPCORE-172), with which I 
agree.

Sometime back my original fix for it, was to not shutdown the buffer, 
while it had data which was not yet read as:

public void shutdown() {
        if (this.shutdown) {
            return;
        }
        if (!hasData() && this.endOfStream) {
            this.shutdown = true;
            synchronized (this.mutex) {
                this.mutex.notifyAll();
            }
        }
    }

However, I think Jasons version of the fix as described in the above 
JIRA is better. Do you have any comments on these approaches?

However, even after the above version of the fix, Eric reported that he 
saw the same resultant error usually caused by this bug in his 
production environment.

I was looking at the following code:

public int consumeContent(final ContentDecoder decoder) throws IOException {
        if (this.shutdown) {
            return -1;
        }

and wondering why you have the above if condition.. is it even remotely 
possible for a consumeContent() call (triggered by an inputReady() to 
come after a closed() call? If so, we may need another fix here..

thanks
asankha

-- 
Asankha C. Perera

WSO2 - http://wso2.org
http://esbmagic.blogspot.com


Mime
View raw message