hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DELHOSTE Fabrice <Fabrice.DELHO...@gemalto.com>
Subject AsyncHttpClient Advice
Date Wed, 24 Mar 2010 16:19:32 GMT

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.


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

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


            if (getAllocatedTotal() >= this.maxTotal) {
                if (!this.availableSessions.isEmpty()) {
                    PoolEntry<T> entry = this.availableSessions.remove();
                    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.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message