How to use binary protocol in spymemcached?

622 views
Skip to first unread message

Lucia

unread,
Jan 13, 2009, 4:25:42 AM1/13/09
to memcached
Hello,

I'm new to memcached and I want to test the binary protocol in
spymemcached 2.2 and memcached 1.3.0.The test enviroment gose well
when not using binary connection but failed when I use:
"mCache = new MemcachedClient(new BinaryConnectionFactory
(),AddrUtil.getAddresses(server+":"+port));"

The exception occurs when call the set fuction of MemcachedClient.
-----------------------------------------------------------------------------------------------------------------
INFO net.spy.memcached.MemcachedConnection: Reconnecting due to
exception on {QA sa=/10.194.132.206:13000, #Rops=1, #Wops=0, #iq=0,
topRop=net.spy.memcached.protocol.binary.StoreOperationImpl@1d95da8,
topWop=null, toWrite=0, interested=1}
java.io.IOException: An existing connection was forcibly closed by the
remote host
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(Unknown Source)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source)
at sun.nio.ch.IOUtil.read(Unknown Source)
at sun.nio.ch.SocketChannelImpl.read(Unknown Source)
at net.spy.memcached.MemcachedConnection.handleReads
(MemcachedConnection.java:303)
at net.spy.memcached.MemcachedConnection.handleIO
(MemcachedConnection.java:264)
at net.spy.memcached.MemcachedConnection.handleIO
(MemcachedConnection.java:184)
at net.spy.memcached.MemcachedClient.run(MemcachedClient.java:1298)
2009-01-13 17:14:32.694 WARN net.spy.memcached.MemcachedConnection:
Closing, and reopening {QA sa=/10.194.132.206:13000, #Rops=1, #Wops=0,
#iq=0,
topRop=net.spy.memcached.protocol.binary.StoreOperationImpl@1d95da8,
topWop=null, toWrite=0, interested=1}, attempt 0.
2009-01-13 17:14:32.694 WARN
net.spy.memcached.protocol.binary.BinaryMemcachedNodeImpl: Discarding
partially completed op:
net.spy.memcached.protocol.binary.StoreOperationImpl@1d95da8
--------------------------------------------------------------------------------------------------------------

And I've tried memcached 1.2.6 but seems no better then 1.3.0.
Anyone met this issue before? I doubt on client API and memcached
instance either, but no idea how to find the root cause. Thanks for
any clue!

Lucia

Dustin

unread,
Jan 13, 2009, 12:34:53 PM1/13/09
to memcached

Try running the server in debug mode (memcached -vv) -- it seems to
be hanging up on you.

I don't actually *have* a 1.3 tag, so I'm not sure what that is.
The binary protocol has gone through quite a few revisions so it's
quite likely that that version just doesn't work at all due to
structural changes.

Your best bet for trying this is to grab my github repo and try a
fresh build off the rewritten-bin branch:

git clone git://github.com/dustin/memcached.git
cd memcached
git checkout -t origin/rewritten-bin

[proceed to build and test]

Lucia

unread,
Jan 14, 2009, 10:26:06 PM1/14/09
to memcached

Thanks very much! The code from you git really works well, will it be
an official version?

On Jan 14, 1:34 am, Dustin <dsalli...@gmail.com> wrote:
>   Try running the server in debug mode (memcached -vv) -- it seems to
> be hanging up on you.
>
>   I don't actually *have* a 1.3 tag, so I'm not sure what that is.
> The binary protocol has gone through quite a few revisions so it's
> quite likely that that version just doesn't work at all due to
> structural changes.
>
>   Your best bet for trying this is to grab my github repo and try a
> fresh build off the rewritten-bin branch:
>
>   git clone git://github.com/dustin/memcached.git
>   cd memcached
>   git checkout -t origin/rewritten-bin
>
>    [proceed to build and test]
>
> On Jan 13, 1:25 am, Lucia <LuciaHuang.m...@gmail.com> wrote:
>
>
>
> > Hello,
>
> > I'm new to memcached and I want to test the binary protocol in
> > spymemcached 2.2 and memcached 1.3.0.The test enviroment gose well
> > when not using binary connection but failed when I use:
> > "mCache = new MemcachedClient(new BinaryConnectionFactory
> > (),AddrUtil.getAddresses(server+":"+port));"
>
> > The exception occurs when call the set fuction of MemcachedClient.
> > ---------------------------------------------------------------------------­--------------------------------------
> > ---------------------------------------------------------------------------­-----------------------------------
>
> > And I've tried memcached 1.2.6 but seems no better then 1.3.0.
> > Anyone met this issue before? I doubt  on client API and memcached
> > instance either, but no idea how to find the root cause. Thanks for
> > any clue!
>
> > Lucia- Hide quoted text -
>
> - Show quoted text -

Dustin

unread,
Jan 14, 2009, 11:06:04 PM1/14/09
to memcached

On Jan 14, 7:26 pm, Lucia <LuciaHuang.m...@gmail.com> wrote:
> Thanks very much! The code from you git really works well, will it be
> an official version?

Yes, we're in the final stages of tree cleanup, and this branch will
be master.
Reply all
Reply to author
Forward
0 new messages