Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught exception in enqueueOperation #60

Open
jrray opened this issue Apr 26, 2018 · 2 comments
Open

Uncaught exception in enqueueOperation #60

jrray opened this issue Apr 26, 2018 · 2 comments

Comments

@jrray
Copy link

jrray commented Apr 26, 2018

The calls to mconn.enqueueOperation in SpyMemcachedIntegration can throw IllegalStateException when the queue is full:

java.lang.IllegalStateException: Timed out waiting to add Cmd: 1 Opaque: 229348 Key: XXX Cas: 0 Exp: 1556244278 Flags: 0 Data Length: 0(max wait=10000ms)
        at net.spy.memcached.protocol.TCPMemcachedNodeImpl.addOp(TCPMemcachedNodeImpl.java:362)
        at net.spy.memcached.MemcachedConnection.addOperation(MemcachedConnection.java:1278)
        at net.spy.memcached.MemcachedConnection.addOperation(MemcachedConnection.java:1240)
        at net.spy.memcached.MemcachedConnection.enqueueOperation(MemcachedConnection.java:1196)
        at shade.memcached.internals.SpyMemcachedIntegration.realAsyncSet(SpyMemcachedIntegration.scala:235)
        at shade.memcached.MemcachedImpl.set(MemcachedImpl.scala:60)

This ends up breaking the implied contract of always returning a Future when calling set, etc.

@lloydmeta
Copy link
Collaborator

Oh nice find. Maybe we can wrap those queue inserts in a try {} catch {}, maybe abstracted in another method, and on failure, fulfil the Promise with the exception.

@jrray
Copy link
Author

jrray commented Apr 26, 2018

My "random guy on the internet" two cents would be push the call to mconn.enqueueOperation down into prepareFuture where this error case can be handled in a central place. It looks like every call to prepareFuture(key, op, ...) is preceded by a call to mcomm.enqueueOperation(key, op).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants