Have a bug in java client 1.5?

Greg Whalin greg at meetup.com
Tue Feb 27 05:13:19 UTC 2007


Known bug that should be fixed shortly.  Client pool freaks out when all
cache servers shut down.

gw

On 2/27/07, Mickey <mickeypublic at gmail.com> wrote:
>
> I use the memcached's java client 1.5 version(compile by JDK1.5). But I
> encounter a problem:
> When the memcached's server is closed, the client throw a exception (
> java.net.ConnectException: Connection refused: connect) and the thread be
> blocked, the cpu utilization achieve 100% . what should I do ? thanks
>
> This is my code:
>   try {
>
>    SockIOPool pool = SockIOPool.getInstance();
>    pool.setServers(new String[]{"localhost:11211"});
>    pool.setFailover(true);
>    pool.initialize();
>    MemCachedClient mc = new MemCachedClient();
>
>    while(true){
>     Thread.sleep(1000);
>     mc.set("abc", "abc");
>     System.out.println("Set");
>     String s = (String)mc.get("abc");
>     System.out.println ("cached:"+s);
>     break;
>    }
>   } catch (Throwable e) {
>      e.printStackTrace();
>    return;
>   }
>



-- 
Greg Whalin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.danga.com/pipermail/memcached/attachments/20070227/c97af80c/attachment.htm


More information about the memcached mailing list