Skip to content

Fix for applyForEach implementation on BigQueueImpl when gc is called #2

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

Closed
wants to merge 2 commits into from
Closed

Fix for applyForEach implementation on BigQueueImpl when gc is called #2

wants to merge 2 commits into from

Conversation

richardtan
Copy link

@richardtan richardtan commented Oct 11, 2022

@brianhks - I see that you have been maintaining the bigqueue repo, so I thought i raise and fix an issue that we have been experiencing.
We are currently using the old implementation from the bulldog project.

We noticed an issue with the applyForEach implementation in the BigQueueImpl class whereby if you action a gc(), it changes the scope of the data in the BigArrayImpl that is not consider for the applyForEach method.

I have created a new test for this, if you run this this on the current implemention it will fail and if you walk though the test, you can see that it should be working. A small fix for this has been made.

Please consider this as a patch.

Tan Richard added 2 commits October 11, 2022 17:53
…s called on the bigQueue, this.innerArray.size() used in the iterator will not work. This is due to the gc() method changing this.arrayTailIndex on BigArrayImpl to a value before the pointer to the front of the queue.

applyForEach assumes that this.arrayTailIndex on BigArrayImpl will always be 0, which is not correct.
…s called on the bigQueue, this.innerArray.size() used in the iterator will not work. This is due to the gc() method changing this.arrayTailIndex on BigArrayImpl to a value before the pointer to the front of the queue.

applyForEach assumes that this.arrayTailIndex on BigArrayImpl will always be 0, which is not correct.
@brianhks
Copy link
Member

Nice pull request, very well done. Not sure why you commented out the removeAll at the bottom of the test though. I'm going to manually merge this into the develop branch and then release a new version.

brianhks added a commit that referenced this pull request Oct 13, 2022
@brianhks
Copy link
Member

Created 1.0.3 version with this fix.

@brianhks brianhks closed this Oct 13, 2022
@richardtan
Copy link
Author

@brianhks I accidently did that. I readded it back on in a later commit.

@arorashubham
Copy link

arorashubham commented Nov 30, 2022

Hey! @brianhks can you please help with newer version of BigQueue that you have mentioned above. I see only 0.7.0 is available on maven repo.

@brianhks
Copy link
Member

https://search.maven.org/artifact/org.kairosdb/bigqueue
This is on a new fork of the code I've been maintaining.

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

Successfully merging this pull request may close these issues.

3 participants