Comments (6)
Another stack trace obtained via jstack:
java.lang.Thread.State: RUNNABLE
at io.reactivex.internal.queue.SpscLinkedArrayQueue.lvElement(SpscLinkedArrayQueue.java:251)
at io.reactivex.internal.queue.SpscLinkedArrayQueue.poll(SpscLinkedArrayQueue.java:138)
at io.reactivex.internal.queue.SpscLinkedArrayQueue.clear(SpscLinkedArrayQueue.java:186)
at io.reactivex.internal.operators.flowable.FlowableOnBackpressureBuffer$BackpressureBufferSubscriber.cancel(FlowableOnBackpressureBuffer.java:154)
at io.reactivex.internal.subscribers.BasicFuseableSubscriber.cancel(BasicFuseableSubscriber.java:158)
at io.reactivex.internal.subscriptions.SubscriptionHelper.cancel(SubscriptionHelper.java:181)
at io.reactivex.internal.subscribers.StrictSubscriber.cancel(StrictSubscriber.java:77)
at graphql.execution.reactive.DelegatingSubscription.cancel(DelegatingSubscription.java:26)
at graphql.kickstart.execution.subscriptions.SessionSubscriptions.cancel(SessionSubscriptions.java:37)
at graphql.kickstart.execution.subscriptions.DefaultSubscriptionSession.unsubscribe(DefaultSubscriptionSession.java:47)
at graphql.kickstart.execution.subscriptions.apollo.SubscriptionStopCommand.apply(SubscriptionStopCommand.java:15)
at graphql.kickstart.execution.subscriptions.apollo.ApolloSubscriptionConsumer.accept(ApolloSubscriptionConsumer.java:25)
at graphql.kickstart.execution.subscriptions.apollo.ApolloSubscriptionConsumer.accept(ApolloSubscriptionConsumer.java:11)
at graphql.kickstart.servlet.GraphQLWebsocketServlet$1.onMessage(GraphQLWebsocketServlet.java:146)
at graphql.kickstart.servlet.GraphQLWebsocketServlet$1.onMessage(GraphQLWebsocketServlet.java:142)
at org.apache.tomcat.websocket.WsFrameBase.sendMessageText(WsFrameBase.java:415)
at org.apache.tomcat.websocket.server.WsFrameServer.sendMessageText(WsFrameServer.java:129)
at org.apache.tomcat.websocket.WsFrameBase.processDataText(WsFrameBase.java:515)
at org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:301)
at org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:133)
at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:85)
at org.apache.tomcat.websocket.server.WsFrameServer.doOnDataAvailable(WsFrameServer.java:183)
at org.apache.tomcat.websocket.server.WsFrameServer.notifyDataAvailable(WsFrameServer.java:162)
at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.upgradeDispatch(WsHttpUpgradeHandler.java:156)
at org.apache.coyote.http11.upgrade.UpgradeProcessorInternal.dispatch(UpgradeProcessorInternal.java:60)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:59)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
- locked <0x00000006c8a00140> (a org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper)
at java.util.concurrent.ThreadPoolExecutor.runWorker([email protected]/ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run([email protected]/ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run([email protected]/Thread.java:830)
It seems that poll()
call is always returning a value different than null.
from rxjava.
An infinite loop in clear
usually indicates some part of the flow called an onNext
concurrently at some point, which is not allowed.
Anything non-standard is your attachListener
so if whatever drives the the emitter in there gets called concurrently, you'll get a corrupted queue.
from rxjava.
The serialized observer can resolve this issue for me? Or I have to synchronize onNext call by myself?
The way we implemented, onNext call be called concurrently.
The attach listener call, wraps a ApplicationListener from spring (A listener that receives application events that happened)(It can be asynchronous) and make it call onNext every time a new evened is received.
from rxjava.
-> https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/ObservableEmitter.html
Observable.create(emitter -> {
ObservableEmitter<T> serializedEmitter = emitter.serialize();
someApi.addListener(data -> {
serializedEmitter.onNext(data);
});
});
from rxjava.
Just to confirm. A concrete example:
ConnectableObservable<T> connectableObservable =
Observable.create(emitter -> {
ObservableEmitter<T> serializedEmitter = emitter.serialize();
configurableApplicationContext.addApplicationListener(event -> serializedEmitter::onNext);
}).share().publish();
connectableObservable.connect();
return connectableObservable.toFlowable(BackpressureStrategy.BUFFER);
My observer should call serialize as well?
ConnectableObservable<T> connectableObservable =
Observable.create(emitter -> {
ObservableEmitter<T> serializedEmitter = emitter.serialize();
configurableApplicationContext.addApplicationListener(event -> serializedEmitter::onNext);
}).serialize().share().publish();
connectableObservable.connect();
return connectableObservable.toFlowable(BackpressureStrategy.BUFFER);
Thanks a lot for your help!
from rxjava.
No need to call serialize()
after create
.
from rxjava.
Related Issues (20)
- v3.1.4: race condition in DeferredScalarSubscription HOT 4
- v3: The marble diagram for cast is incredibly misleading.
- No Development on RxKotlin HOT 5
- missing PNG files in the documentation HOT 1
- 3.x: Items dropped by observeOn without backpressure errors HOT 2
- Consumer buffer of flowable leaks memory HOT 3
- UndeliverableException when use zip compose 2 observable , send Exceptions at same time in the two Observable 。 HOT 3
- Weird Flowable behavior when flatMapCompletable is being executed in a different thread HOT 2
- Adopt the Scorecard Action to monitor the project's security posture
- DeferredScalarDisposable throws NullPointerException HOT 2
- `3.x` In README.md, add a link to the mentioned JavaFX Scheduler HOT 2
- Broken link in docs/Getting-Started.md
- Marble diagram for `Observable.concatMapMaybe` is wrong HOT 8
- repeatWhen terminate HOT 3
- What does it mean due to lack of requests in MissingBackpressureException HOT 2
- FlowableObserveOn.BaseObserveOnSubscriber will ignore the next datas when cosumer throw exception HOT 3
- Flowable.firstOrError interrupts the thread downstream. HOT 4
- io.reactivex.rxjava3.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with HOT 1
- Some Schedulers along with lockingGet will make the application hang HOT 1
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 rxjava.