Closed GoogleCodeExporter closed 9 years ago
I have the same problem on Centos 64 bit and memcache server 1.2.6.
What can i make to change the timeout or resolve the bug?
Thx,
AVC
Original comment by arekczar...@gmail.com
on 9 Oct 2008 at 2:29
I added some code to attempt to reproduce this problem, but can't.
Specifically, I added a unit test that definitely times out and validates that
it
does see an operation timeout exception, and that it can see a value afterwards:
http://github.com/dustin/java-memcached-client/commit/8c489ffa
If you guys can reproduce the failure with this test, or perhaps modify it in
such a
way that will produce a failure, that'd be helpful.
Otherwise, I'm going to have to declare this invalid as I understand it.
Original comment by dsalli...@gmail.com
on 19 Dec 2008 at 4:42
I can reproduce this bug in my local environment.
Client OS: Windows XP
Server OS: Ubuntu
memcached 1.2.6
spymemcached 2.2
Code:
ConnectionFactory connectionFactory = new BinaryConnectionFactory();
MemcachedClient client =
new MemcachedClient(
connectionFactory,
AddrUtil.getAddresses("remote-host:11211")
);
client.set("key1", 30 * 60, "value1");
System.out.println(client.get("key1"));
client.shutdown();
Original comment by sskladch...@gmail.com
on 6 Feb 2009 at 10:41
sskladchikov,
Version 1.2.6 doesn't support a binary protocol. You should have better luck
with
DefaultConnectionFactory.
Original comment by dsalli...@gmail.com
on 6 Feb 2009 at 10:17
Do i need to shutdown the connection each time and reconnect it while setting or
getting the value from memcached? is it possible to have only one connection of
memcached?
Original comment by babybaby...@gmail.com
on 22 Apr 2009 at 5:53
If I try to get something without storing it first or cache does not have when
get is
invoked, this exception is noticed
MemcachedClient c = new MemcachedClient(
new BinaryConnectionFactory(), AddrUtil
.getAddresses("localhost" + ":"
+ 11211));
c.get("someKey");
Please let me know, how this can be resolved?
Original comment by kmukd...@gmail.com
on 3 Oct 2009 at 2:59
kmukdapu: I have no idea what you're seeing. Is your server running? I
pasted that
exact code into a new class, ran it, and verified that it returned null as
expected.
Original comment by dsalli...@gmail.com
on 4 Oct 2009 at 5:55
Hi there,
I am seeing the same thing when I call get(). Did you guys find a solution for
this?
I am running:
Server: 1.2.8
Client: Spy (memcached-2[1].3.1.jar)
JDK: 1.5
Windows Sever 2003 x64 SP2
Thanks!
Matt
Original comment by mattmcdo...@gmail.com
on 12 Oct 2009 at 10:17
This is a bit long standing because I've not been able to reproduce it and some
of
the closest I've seen have involved people misconfiguring something (such as
the
user above who had too old a version of memcached while trying to use the binary
protocol).
I would gladly fix the bug if I could see it happen. :(
Original comment by dsalli...@gmail.com
on 12 Oct 2009 at 10:34
Thanks for the quick reply.
Could it be specific to 64 bit machines? I see first user also has a 64bit.
Also, should the versions I have work together?
Server: 1.2.8
Client: Spy (memcached-2[1].3.1.jar)
thanks,
Matt
Original comment by mattmcdo...@gmail.com
on 12 Oct 2009 at 11:17
My machine is 32 bit
I have tried both memcached server version 1.2.1 and 1.2.0
(http://jehiah.cz/projects/memcached-win32/)
TEST CODE
@Test
public void shouldNotThrowException() throws IOException {
MemcachedClient memcachedClient = new MemcachedClient( new
BinaryConnectionFactory(), AddrUtil.getAddresses("127.0.0.1:11211"));
long start = System.currentTimeMillis();
memcachedClient.set("TEST_JAVA_VALUE", -1, "a");
System.out.println("Set took " + (System.currentTimeMillis() - start) +
"ms.");
start = System.currentTimeMillis();
String value = (String)memcachedClient.get("TEST_JAVA_VALUE");
System.out.println("Retrieve took " + (System.currentTimeMillis() -start) +
"ms.");
}
if i have tried the test code with 2.4.2 i get the exception;
net.spy.memcached.OperationTimeoutException: Timeout waiting for value
at net.spy.memcached.MemcachedClient.get(MemcachedClient.java:853)
at net.spy.memcached.MemcachedClient.get(MemcachedClient.java:868)
if i have tried the test code with memcached 2.5
net.spy.memcached.OperationTimeoutException: Timeout waiting for value
at net.spy.memcached.MemcachedClient.get(MemcachedClient.java:924)
at net.spy.memcached.MemcachedClient.get(MemcachedClient.java:939)
If i have used SSM, there is no problem, But when i try to use memcached
directly as
testcode above i get timeout exception.
net.spy.memcached.OperationTimeoutException: Timeout waiting for value
I ve checked my server is running.
Original comment by osmans...@gmail.com
on 24 May 2010 at 1:28
I was able to fix this by adding the time out, by overriding the get() method.
MemcachedClient c = new MemcachedClient(new BinaryConnectionFactory(),
AddrUtil.getAddresses("host:1port"));
java.util.concurrent.Future<Object> f = c.asyncGet(NAMESPACE +key);
Object o = f.get(1800, TimeUnit.SECONDS);
I know that less time out is good for the application because your application
won't wait. But in my case, I have to build huge cache during some requests,
which takes 20 minutes. The subsequent requests will be faster.
Thanks
Abhilash
Original comment by abhih...@gmail.com
on 28 Oct 2010 at 7:00
I know this issue is closed, but I did want to note that I've enhanced the test
for this a bit while working on issue 136. The updated test definitely shows
that once a timeout occurs, the client can recover.
Original comment by ingen...@gmail.com
on 3 Jan 2011 at 1:18
Original issue reported on code.google.com by
jpvirola...@gmail.com
on 4 Sep 2008 at 2:55