Async view query hangs under strange conditions

Description

Here is a example of code to reproduce the bug:

(do not look at how hugly the code is, it's just to highlight the bug.

Environment

None

Gerrit Reviews

None

Release Notes Description

None

Activity

Show:

Simon Baslé January 6, 2016 at 10:51 AM

(fixed per discussion/clarification on the correct usage)

Romain Cambier January 6, 2016 at 10:49 AM

Yep: my problem was that I had no control on the authenticator Thank you again !

Simon Baslé January 6, 2016 at 10:48 AM

no problem, reasoning about mixing blocking and non-blocking code is hard and can be counterintuitive, so I hope that I could help in that regard. I'll close this issue, then.

Romain Cambier January 6, 2016 at 10:30 AM

Well, thanks for your time & help Simon!

Simon Baslé January 6, 2016 at 10:27 AM

It is more complex than that. You are dealing with multiple asynchronous streams that have complex interactions and you throw threading/synchronization problems into the mix. This can cause race conditions, dealocks/livelocks, etc...

Blocking inside a map/flatmap is regarded as a malpractice in the Rx world, and if you absolutely must call blocking code you have to switch to proper threads using Schedulers.io() or Schedulers.newThread().

We made a reminder note of absolutely avoiding that in the documentation (granted this can be easily missed, but see second note in http://developer.couchbase.com/documentation/server/4.0/sdks/java-2.2/observables.html#story-h2-5).

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Components

Affects versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created January 4, 2016 at 2:36 PM
Updated January 6, 2016 at 10:52 AM
Resolved January 6, 2016 at 10:51 AM
Instabug