Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TopicProcessor (Critical): onNext makes out of RingBuffer capacity after some time without subscribers #206

Open
mayras opened this issue May 7, 2019 · 0 comments

Comments

@mayras
Copy link

mayras commented May 7, 2019

Make TopicProcessor with size of RingBuffer equals 1024 and start to call topicProcessor.onNext without subscribers, when RingBuffer will be full try to subscribe to topicProcessor and you will get nothing. It's not normal behaviour, (RingBuffer.Sequence minimum) must follow to cursor of RingBuffer to avoid such situations. Next code of TopicProcessor makes problem (from line 314) when it starts from minimum which is -1 when first subscriber comes:

//bind eventProcessor sequence to observe the ringBuffer

//if only active subscriber, replay missed data
if (incrementSubscribers()) {

	signalProcessor.sequence.set(minimum.getAsLong());
	ringBuffer.addGatingSequence(signalProcessor.sequence);
	//set eventProcessor sequence to minimum index (replay)
}

Reactor Core version
3.2.8.RELEASE

JVM version (e.g. java -version)
1.8.0_171

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant