Comments (11)
Another thing I'm seeing is sometimes I'll do a multiget on a couple of keys with no index, get a cursor back, call "seq" on it and get a result that hangs forever. I don't see anything bad in the logs for RethinkDB. Any thoughts here?
from clj-rethinkdb.
Also, what's the reason for the Thread/sleep
call in the seq
implementation for Cursor?
from clj-rethinkdb.
@sritchie see #68 and follow the links to understand more about this until I have the chance to document it properly. I think that's part of the problem but there may be more there. RethinkDB distinguishes between lazy seq operations and eagerly loaded vectors. Operations without an index will require the dataset to be loaded into memory before returning and will come back as an array, operations that can take advantage of the index will come back as a seq.
However I think there's something going on in your code I don't understand yet.
The sleep call is to avoid overwhelming the RethinkDB server requesting changefeeds. It's being fixed in the new core.async implementation I'm working on at the moment by upgrading the driver version to v4 which handles changefeeds in a nicer way.
from clj-rethinkdb.
Okay, cool. My big issue is that when I call seq on the cursors they hang forever. (At least for 5 minutes before I killed the thread in the 2-item get-all that I tested out.)
from clj-rethinkdb.
Do you guys have any idea why calling seq causes an infinite hang?
from clj-rethinkdb.
Maybe a better question - is there some way to just prevent Cursors from ever coming back and force all calls to be synchronous?
from clj-rethinkdb.
@sritchie you could call http://rethinkdb.com/api/javascript/coerce_to/, although this isn't necessarily the best as it will result in higher memory usage on the server. Take a look at the different types that can be returned in the API http://rethinkdb.com/api/javascript/ and how they depend on the input type. This should give you an intuition for when you'll get a Cursor or an array.
Now to your race condition bug, I'm 90% certain this is a bug in RethinkDB. I can reproduce this reliably, and this behaviour occurs even after running it on the same table several times (in case the index hadn't been completely built). Do you want to report this to RethinkDB? I'm happy to help.
If you can give me a minimal reproduction case for the seq
hanging bug I can take a closer look at it.
from clj-rethinkdb.
coerce-to
seems to work. I'll go with that for now, since I'm only hitting this index for a couple of items. I'd love some help filing a bug with RethinkDB. Is there some way to log the commands we're sending over so we can just report that sequence? I'll follow your lead here.
from clj-rethinkdb.
@sritchie I've opened rethinkdb/rethinkdb#4616 about this.
from clj-rethinkdb.
The full details are in rethinkdb/rethinkdb#4616 and rethinkdb/docs#843, but the short version is that this is a deficiency in the current driver. Both of those results should be returned in a uniform interface. The upcoming work on a core.async API should be helpful for this.
from clj-rethinkdb.
@danielcompton that's a fantastic bug report, and helps me understand much better what's going on. Thanks again for all your help!
from clj-rethinkdb.
Related Issues (20)
- RethinkDB 2.3 handshake V1.0 implementation
- Unwanted stacktraces HOT 8
- View rethink queries as JS? HOT 2
- Improve performance of byte handling HOT 1
- add a `grant` method HOT 7
- add r/expr term HOT 3
- Dependency on Aleph and Netty causes issues deploying to wildfly and jboss HOT 10
- SocketException: Address already in use: /127.0.0.1:28015 HOT 1
- Call to clojure.core/refer-clojure did not conform to spec HOT 2
- Ability to use index in distinct HOT 1
- rethinkdb.query/term? should be public HOT 1
- Any reason not to use protobuf-java 3.0.2? HOT 2
- how to use nested without? HOT 2
- `:temp-var` leaks into query result
- closed connection is not detected
- r/branch support multiple conditions
- Arrays in optargs
- sorted-set is not supported and causes exceptions to be thrown
- Communication with RethinkDB freezing/hanging completely HOT 5
- rethinkdb.net/deliver-result tries to conj to ex-info, which fails HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clj-rethinkdb.