{"action":"created","issue":{"url":"https://api.github.com/repos/ReactiveX/RxJava/issues/3090","labels_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/3090/labels{/name}","comments_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/3090/comments","events_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/3090/events","html_url":"https://github.com/ReactiveX/RxJava/issues/3090","id":96084053,"number":3090,"title":"Concat (hot) error handling guarantees","user":{"login":"artem-zinnatullin","id":967132,"avatar_url":"https://avatars.githubusercontent.com/u/967132?v=3","gravatar_id":"","url":"https://api.github.com/users/artem-zinnatullin","html_url":"https://github.com/artem-zinnatullin","followers_url":"https://api.github.com/users/artem-zinnatullin/followers","following_url":"https://api.github.com/users/artem-zinnatullin/following{/other_user}","gists_url":"https://api.github.com/users/artem-zinnatullin/gists{/gist_id}","starred_url":"https://api.github.com/users/artem-zinnatullin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artem-zinnatullin/subscriptions","organizations_url":"https://api.github.com/users/artem-zinnatullin/orgs","repos_url":"https://api.github.com/users/artem-zinnatullin/repos","events_url":"https://api.github.com/users/artem-zinnatullin/events{/privacy}","received_events_url":"https://api.github.com/users/artem-zinnatullin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-20T15:03:37Z","updated_at":"2015-07-20T17:35:14Z","closed_at":null,"body":"According to the documentation of the Concat operator http://reactivex.io/documentation/operators/concat.html error, happened on one of the source observables may (keyword here) \"jump the queue\" and trigger `onError` of the `Concat` Observable.\r\n\r\n> Note that if the source Observables are “hot” and are therefore sending their emissions and notifications to the Concat concurrently, an onError notification from any of the source Observables may “jump the queue” and trigger an onError notification from the Observable that results from the Concat operation — even if the source Observable that was the source of the error notification has not yet begun to be concatenated to that resulting Observable.\r\n\r\n![Marble diagram](http://reactivex.io/documentation/operators/images/concat.hot.png)\r\n\r\nBut this simple test fails (same as marble diagram):\r\n\r\n```java\r\n@Test\r\npublic void errorOnOneOfTheSourceObservablesShouldStopConcat() {\r\n  PublishSubject<String> o1 = PublishSubject.create();\r\n  PublishSubject<String> o2 = PublishSubject.create();\r\n\r\n  TestSubscriber<String> testSubscriber = new TestSubscriber<>();\r\n\r\n  Observable\r\n    .concat(o1, o2)\r\n    .subscribe(testSubscriber);\r\n\r\n  o1.onNext(\"red\");\r\n  o2.onNext(\"yellow\");\r\n  o1.onNext(\"green\");\r\n  o2.onError(new IllegalStateException(\"o2 error\"));\r\n  o1.onNext(\"blue\");\r\n  o1.onCompleted();\r\n\r\n  // In fact we have:\r\n  testSubscriber.assertValues(\"red\", \"green\", \"blue\");\r\n  testSubscriber.assertError(IllegalStateException.class);\r\n\r\n  // But according to marble diagram http://reactivex.io/documentation/operators/concat.html\r\n  // Error on one of the observables should stop concat\r\n  testSubscriber.assertValues(\"red\", \"green\"); // We should not see \"blue\" here.\r\n  testSubscriber.assertError(IllegalStateException.class);\r\n}\r\n```\r\n\r\nIs it expected behavior or there are no guarantees that error will \"jump the queue\" and trigger `onError` on the `Concat` Observable? We just faced it in production (not critical problem, but we expected behavior according to the documentation).\r\n\r\nP.S. Checked on RxJava 1.0.12 and 1.0.13-SNAPSHOT (today), also tried to emit values from different threads — no difference. I can submit this test as PR if you want."},"comment":{"url":"https://api.github.com/repos/ReactiveX/RxJava/issues/comments/122962970","html_url":"https://github.com/ReactiveX/RxJava/issues/3090#issuecomment-122962970","issue_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/3090","id":122962970,"user":{"login":"DavidMGross","id":4491168,"avatar_url":"https://avatars.githubusercontent.com/u/4491168?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidMGross","html_url":"https://github.com/DavidMGross","followers_url":"https://api.github.com/users/DavidMGross/followers","following_url":"https://api.github.com/users/DavidMGross/following{/other_user}","gists_url":"https://api.github.com/users/DavidMGross/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidMGross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidMGross/subscriptions","organizations_url":"https://api.github.com/users/DavidMGross/orgs","repos_url":"https://api.github.com/users/DavidMGross/repos","events_url":"https://api.github.com/users/DavidMGross/events{/privacy}","received_events_url":"https://api.github.com/users/DavidMGross/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T17:35:14Z","updated_at":"2015-07-20T17:35:14Z","body":"I wrote this section of the docs, and I wish now I remember why. It may be\nthat someone had reported this behavior in an earlier version of RxJava, or\nmaybe it was something I picked up from reading about Rx.NET or some other\nimplementation and just assumed it was generalizable.  I don't think I\nwould have gratuitously added a note like this without having observed it\nsomewhere.\n\nIt sounds like it's just confusing and misleading at this point, though, so\nI'll get rid of it.\n\nOn Mon, Jul 20, 2015 at 8:58 AM, Artem Zinnatullin <notifications@github.com\n> wrote:\n\n> That's good, because I was curios about \"jump the queue\" impl after\n> playing with RxJava sources and debugging.\n>\n> So, let's fix documentation! Or other Rx implementations may have this\n> \"jump the queue\" effect?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/ReactiveX/RxJava/issues/3090#issuecomment-122926708>.\n>\n\n\n\n-- \nDavid M. Gross\nPLP Consulting\n"}}