checking for timeout

33 views
Skip to first unread message

Alexandre Russel

unread,
May 20, 2016, 4:18:00 AM5/20/16
to ReactiveMongo - http://reactivemongo.org
Hi,

  We have some code doing (using play plugin):

```
Foo.collection. cursor(Json.obj()).collect[List]().map {
  results =>
   Bar.collection.aggregate(/*do some aggregation with the results */)
}
```
This always gives us a result so I've assumed that everything was working fine, but we realized that sometimes only some part of the first query is being passed to aggregate, and when this happen this is always 101 documents. So I"m assuming that only the first batch of document has been processed, then they were maybe a timeout so the rest didn't come through. I would expect in such a case to be made aware of an error so the first Future to fail, but nothing happens. Have I misunderstood something ? Is there a check I should do to make sure that it has worked properly ? Note that I understand that I could change the batch size or use an iterator, but here I'm really trying to understand why `Foo.collection. cursor(Json.obj()).collect[List]()` does not fail when it doesn't get all results.

Alex

Cédric Chantepie

unread,
May 20, 2016, 7:24:46 AM5/20/16
to ReactiveMongo - http://reactivemongo.org
What version are you using? If not the latest release (0.11.11), I suggest you try with it.

Alexandre Russel

unread,
May 20, 2016, 8:53:45 AM5/20/16
to reacti...@googlegroups.com
0.11.9, I'll upgrade and report if any problem persists,
thanks for your help

On Fri, May 20, 2016 at 1:24 PM, Cédric Chantepie <chantep...@gmail.com> wrote:
What version are you using? If not the latest release (0.11.11), I suggest you try with it.

--
You received this message because you are subscribed to a topic in the Google Groups "ReactiveMongo - http://reactivemongo.org" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/reactivemongo/sMkujWyzmLc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to reactivemong...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alexandre Russel

unread,
May 21, 2016, 9:23:50 AM5/21/16
to ReactiveMongo - http://reactivemongo.org
I'm finding the migration  not as trivial as I thought, I'm trying to remove the deprecation warning:
- method documents in class AggregationResult is deprecated: Use [[firstBatch]]
=> if I want all results, do I have to first get the firstBatch and then check the cursor, do we have some code snippets somewhere ?

- method enumerate in trait Cursor is deprecated: Use `.enumerator` from Play Iteratee modules
I'm assuming there should be an implicit def somewhere in play-iteratees (I'm using 2.4.6), but can't find it, what import should I use exactly ?

Alex


On Friday, May 20, 2016 at 2:53:45 PM UTC+2, Alexandre Russel wrote:
0.11.9, I'll upgrade and report if any problem persists,
thanks for your help
On Fri, May 20, 2016 at 1:24 PM, Cédric Chantepie <chantep...@gmail.com> wrote:
What version are you using? If not the latest release (0.11.11), I suggest you try with it.

--
You received this message because you are subscribed to a topic in the Google Groups "ReactiveMongo - http://reactivemongo.org" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/reactivemongo/sMkujWyzmLc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to reactivemongo+unsubscribe@googlegroups.com.

Cédric Chantepie

unread,
May 21, 2016, 2:08:36 PM5/21/16
to ReactiveMongo - http://reactivemongo.org
There is examples in the tests about using the reactivemongo-iteratee module: https://github.com/ReactiveMongo/ReactiveMongo/blob/master/iteratees/src/test/scala/CursorSpec.scala

Alexandre Russel

unread,
May 22, 2016, 3:12:04 AM5/22/16
to ReactiveMongo - http://reactivemongo.org
It does use the reactivemongo-iteratee module, which is not imported by default by the play plugin for 2.4. Maybe the play plugin should require it or the deprecation note should explain that an extra module is required. Adding the module fixed my issue, thanks.
Reply all
Reply to author
Forward
0 new messages