parallel-consumer icon indicating copy to clipboard operation
parallel-consumer copied to clipboard

Update LoopingResumingIterator.java

Open HiremathPanchaxari opened this issue 3 years ago • 12 comments

fix for java.util.NoSuchElementException: #hasNext() returned true, but there are no more entries that haven't been iterated.

Description...

Checklist

  • [ ] Documentation (if applicable)
  • [ ] Changelog

HiremathPanchaxari avatar Oct 12 '22 09:10 HiremathPanchaxari

Hi, welcome to the project! Do you have a test case for this that exposes a problem?

astubbs avatar Oct 12 '22 09:10 astubbs

This is in reference to https://github.com/confluentinc/parallel-consumer/issues/419 which got resolved in 0.5.2.3. We are getting java.util.NoSuchElementException: #hasNext() in LoopingResumingIterator.java file

Here we are processing for messages > 40k messages per hour.

Version: 0.5.2.3

During the load test of messages > 40k per hour, the consumer closes down with following exceptions seen. So i have made attempt to fix it. Kindly review it

java.util.NoSuchElementException: #hasNext() returned true, but there are no more entries that haven't been iterated. at io.confluent.csid.utils.LoopingResumingIterator.getNextAndMaybeLoop(LoopingResumingIterator.java:151) at io.confluent.csid.utils.LoopingResumingIterator.findStartingPointAndNextValue(LoopingResumingIterator.java:102) at io.confluent.csid.utils.LoopingResumingIterator.next(LoopingResumingIterator.java:94) at io.confluent.parallelconsumer.state.ShardManager.getWorkIfAvailable(ShardManager.java:211) at io.confluent.parallelconsumer.state.WorkManager.getWorkIfAvailable(WorkManager.java:139) at io.confluent.parallelconsumer.internal.AbstractParallelEoSStreamProcessor.retrieveAndDistributeNewWork(AbstractParallelEoSStreamProcessor.java:781) at io.confluent.parallelconsumer.internal.AbstractParallelEoSStreamProcessor.controlLoop(AbstractParallelEoSStreamProcessor.java:704) at io.confluent.parallelconsumer.internal.AbstractParallelEoSStreamProcessor.lambda$supervisorLoop$5(AbstractParallelEoSStreamProcessor.java:658) at java.base/java.util.concurrent.FutureTask.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source)

HiremathPanchaxari avatar Oct 12 '22 10:10 HiremathPanchaxari

Ok, cool. Do you have a test case for this that exposes a problem?

astubbs avatar Oct 12 '22 10:10 astubbs

I don't have one.

HiremathPanchaxari avatar Oct 12 '22 10:10 HiremathPanchaxari

I don't have one.

Could you make a unit test that exposes the issue?

astubbs avatar Oct 12 '22 10:10 astubbs

ya. sure. i can get build to verify on labs ?

HiremathPanchaxari avatar Oct 12 '22 11:10 HiremathPanchaxari

ya. sure. i can get build to verify on labs ?

If you mean Jenkins, yes our build servers will run the test suite.

astubbs avatar Oct 12 '22 11:10 astubbs

yes. what i will be version of it.

HiremathPanchaxari avatar Oct 12 '22 11:10 HiremathPanchaxari

yes. what i will be version of it.

pardon me?

astubbs avatar Oct 12 '22 12:10 astubbs

what is version of PR and how can use it my project pom for verifying the fix?

HiremathPanchaxari avatar Oct 12 '22 13:10 HiremathPanchaxari

@astubbs - I have added the test case.

HiremathPanchaxari avatar Oct 12 '22 17:10 HiremathPanchaxari

@astubbs is there any pending my side?

HiremathPanchaxari avatar Oct 13 '22 06:10 HiremathPanchaxari

@astubbs - I have added the test case.

@astubbs is there any pending my side?

Thanks, I'll try take a look at it asap.

astubbs avatar Oct 13 '22 12:10 astubbs

@astubbs - please let me know. I am waiting for build. thanks

HiremathPanchaxari avatar Oct 14 '22 16:10 HiremathPanchaxari

@astubbs - please let me know. I am waiting for build. thanks

can you give me write access to your fork? I'll push some additions to your branch

astubbs avatar Oct 17 '22 12:10 astubbs

Were you able to write a load test that reproduced the issue? (Can just be a load test against the iterator system)

astubbs avatar Oct 17 '22 13:10 astubbs

I've pushed my changes here, which should solve this issue. #200 will fix all these sorts of things though - much simpler.

https://github.com/confluentinc/astubbs/parallel-consumer branch: bugs/looper-simplify

Please take a look and see what you think of my changes.

astubbs avatar Oct 17 '22 16:10 astubbs