{"action":"created","issue":{"url":"https://api.github.com/repos/ReactiveX/RxJava/issues/2604","labels_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/2604/labels{/name}","comments_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/2604/comments","events_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/2604/events","html_url":"https://github.com/ReactiveX/RxJava/issues/2604","id":56607492,"number":2604,"title":"OperatorMerge - RxRingBuffer throws IllegalStateException again","user":{"login":"davidmoten","id":318187,"avatar_url":"https://avatars.githubusercontent.com/u/318187?v=3","gravatar_id":"","url":"https://api.github.com/users/davidmoten","html_url":"https://github.com/davidmoten","followers_url":"https://api.github.com/users/davidmoten/followers","following_url":"https://api.github.com/users/davidmoten/following{/other_user}","gists_url":"https://api.github.com/users/davidmoten/gists{/gist_id}","starred_url":"https://api.github.com/users/davidmoten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidmoten/subscriptions","organizations_url":"https://api.github.com/users/davidmoten/orgs","repos_url":"https://api.github.com/users/davidmoten/repos","events_url":"https://api.github.com/users/davidmoten/events{/privacy}","received_events_url":"https://api.github.com/users/davidmoten/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-02-05T00:01:09Z","updated_at":"2015-02-05T09:23:29Z","closed_at":null,"body":"With 1.0.5, I'm getting an ```IllegalStateException``` from ```OperatorMerge```. This is repeatable for me but involves a big input data set being processed in chunks using flatMap/onSubscribe so I can't give you a quick test case yet. Hopefully just this description is enough otherwise I'll try and distill a test. I think it is happening close to completion.\r\n\r\n```\r\njava.lang.IllegalStateException: This instance has been unsubscribed and the queue is no longer usable.\r\n        at rx.internal.util.RxRingBuffer.onNext(RxRingBuffer.java:346)\r\n        at rx.internal.operators.OperatorMerge$InnerSubscriber.enqueue(OperatorMerge.java:721)\r\n        at rx.internal.operators.OperatorMerge$InnerSubscriber.emit(OperatorMerge.java:698)\r\n        at rx.internal.operators.OperatorMerge$InnerSubscriber.onNext(OperatorMerge.java:586)\r\n        at rx.internal.operators.OperatorSubscribeOn$1$1$1.onNext(OperatorSubscribeOn.java:76)\r\n        at rx.internal.operators.OperatorMerge$MergeSubscriber.handleScalarSynchronousObservableWithRequestLimits(OperatorMerge.java:280)\r\n        at rx.internal.operators.OperatorMerge$MergeSubscriber.handleScalarSynchronousObservable(OperatorMerge.java:243)\r\n        at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:176)\r\n        at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:120)\r\n        at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:55)\r\n        at rx.internal.operators.OperatorMerge$MergeSubscriber.handleScalarSynchronousObservableWithRequestLimits(OperatorMerge.java:280)\r\n        at rx.internal.operators.OperatorMerge$MergeSubscriber.handleScalarSynchronousObservable(OperatorMerge.java:243)\r\n        at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:176)\r\n        at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:120)\r\n        at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:55)\r\n        at rx.internal.operators.NotificationLite.accept(NotificationLite.java:150)\r\n        at rx.internal.operators.OperatorMerge$MergeSubscriber.drainScalarValueQueue(OperatorMerge.java:396)\r\n        at rx.internal.operators.OperatorMerge$MergeSubscriber.drainQueuesIfNeeded(OperatorMerge.java:343)\r\n        at rx.internal.operators.OperatorMerge$MergeSubscriber.access$500(OperatorMerge.java:120)\r\n        at rx.internal.operators.OperatorMerge$MergeProducer.request(OperatorMerge.java:549)\r\n        at rx.Subscriber.request(Subscriber.java:130)\r\n        at rx.internal.operators.OperatorMerge$MergeSubscriber.drainQueuesIfNeeded(OperatorMerge.java:350)\r\n        at rx.internal.operators.OperatorMerge$MergeSubscriber.access$500(OperatorMerge.java:120)\r\n        at rx.internal.operators.OperatorMerge$MergeProducer.request(OperatorMerge.java:549)\r\n        at rx.Subscriber.request(Subscriber.java:130)\r\n        at rx.internal.operators.OperatorMerge$MergeSubscriber.drainQueuesIfNeeded(OperatorMerge.java:350)\r\n        at rx.internal.operators.OperatorMerge$MergeSubscriber.access$500(OperatorMerge.java:120)\r\n        at rx.internal.operators.OperatorMerge$MergeProducer.request(OperatorMerge.java:549)\r\n        at rx.internal.operators.OperatorSubscribeOn$1$1$1$1$1.call(OperatorSubscribeOn.java:94)\r\n        at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:47)\r\n        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\r\n        at java.util.concurrent.FutureTask.run(FutureTask.java:266)\r\n        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)\r\n        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)\r\n        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\r\n        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\r\n        at java.lang.Thread.run(Thread.java:745)\r\nCaused by: rx.exceptions.OnErrorThrowable$OnNextValue: OnError while emitting onNext value: au.gov.amsa.ais.Timestamped.class\r\n        at rx.exceptions.OnErrorThrowable.addValueAsLastCause(OnErrorThrowable.java:98)\r\n        at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:58)\r\n        ... 27 more\r\n```"},"comment":{"url":"https://api.github.com/repos/ReactiveX/RxJava/issues/comments/73016828","html_url":"https://github.com/ReactiveX/RxJava/issues/2604#issuecomment-73016828","issue_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/2604","id":73016828,"user":{"login":"akarnokd","id":1269832,"avatar_url":"https://avatars.githubusercontent.com/u/1269832?v=3","gravatar_id":"","url":"https://api.github.com/users/akarnokd","html_url":"https://github.com/akarnokd","followers_url":"https://api.github.com/users/akarnokd/followers","following_url":"https://api.github.com/users/akarnokd/following{/other_user}","gists_url":"https://api.github.com/users/akarnokd/gists{/gist_id}","starred_url":"https://api.github.com/users/akarnokd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akarnokd/subscriptions","organizations_url":"https://api.github.com/users/akarnokd/orgs","repos_url":"https://api.github.com/users/akarnokd/repos","events_url":"https://api.github.com/users/akarnokd/events{/privacy}","received_events_url":"https://api.github.com/users/akarnokd/received_events","type":"User","site_admin":false},"created_at":"2015-02-05T09:23:29Z","updated_at":"2015-02-05T09:23:29Z","body":"Something is unsubscribing because otherwise the queue wouldn't be null."}}