Have a bug in java client 1.5?

Mickey mickeypublic at gmail.com
Tue Feb 27 05:11:29 UTC 2007


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;
  }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.danga.com/pipermail/memcached/attachments/20070227/61d259fa/attachment.html


More information about the memcached mailing list