Hi,

We are currently using the asynchttpclient trunk (thx for previous feedback). 
We encounter 2 problems.

1) In HTTPExchangeImpl constructor, I changed responseFuture to be initialized 
*before* leasing the session (it was after).
Because sometimes the response is so fast that the responseFuture is still 
null...and handlers are sending a NullPointerException.

HTTPExchangeImpl.java:

        this.listener = listener;
        this.responseFuture = new BasicFuture<HttpResponse>(callback);
        this.sessionFuture = sessmrg.leaseSession(route, state, new
InternalFutureCallback());


2) Now, when running under high load test, I encounter the following one during 
this:

SessionPool.java:180

            if (getAllocatedTotal() >= this.maxTotal) {
                if (!this.availableSessions.isEmpty()) {
                    PoolEntry<T> entry = this.availableSessions.remove();
                    entryShutdown(entry);
                    SessionPoolForRoute<T> pool = getPool(entry.getRoute());
                    pool.freeEntry(entry, false);
                }
            }

The freeEntry is sending me an IllegalException coming from SessionPoolForRoute 
saying that "the entry has not been leased from this pool".
I haven't fully dived into the code...if possible, could you please give me 
advice on that so I can find the problem (synchronization?).
At the moment I just made a silly change: I commented this code and everything 
seems to work, even for high loads.

Thanks,
Fabrice

Reply via email to