eclipse-ee4j / glassfish

Eclipse GlassFish
https://eclipse-ee4j.github.io/glassfish/
386 stars 144 forks source link

[BATCH RI] PartitionedStepControllerImpl is one-off when retrieving work from parallelBatchWorkUnits #20335

Closed glassfishrobot closed 11 years ago

glassfishrobot commented 11 years ago

Disclaimer: The bug was found on b25 of the BATCH-RI

Example: Partition plan with 4 partitions and 2 threads On line 334 // Start up to to the max num we are allowed from the num threads attribute The variable numCurrentSubmitted has value 2 after completing this

Starting from line 375 if (readyToSubmitAnother) { numCurrentCompleted++; logger.fine("Ready to submit another (if there is another left to submit); numCurrentCompleted = " + numCurrentCompleted); if (numCurrentCompleted < numTotalForThisExcecution) { if (numCurrentSubmitted < numTotalForThisExcecution) { numCurrentSubmitted++; logger.fine("Submitting # " + numCurrentSubmitted + " out of " + numTotalForThisExcecution + " total for this execution"); if (stepStatus.getStartCount() > 1)

{ batchKernel.startGeneratedJob(parallelBatchWorkUnits.get(numCurrentSubmitted)); }

else

{ batchKernel.restartGeneratedJob(parallelBatchWorkUnits.get(numCurrentSubmitted)); }

readyToSubmitAnother = false;

The numCurrentSubmitted is increased to 3 and the next workUnit is retrieved is 3, thereby skipping entry 2 of the arry. This means that while retrieving the last workUnit an exception is thrown and the third workUnit is never executed.

The exception was: Wed Apr 17 19:37:41 CEST 2013 [com.ibm.jbatch.container.impl.BaseStepControllerImpl execute] WARNING: Caught exception executing step: java.lang.IndexOutOfBoundsException: Index: 4, Size: 4 at java.util.ArrayList.rangeCheck(ArrayList.java:604) at java.util.ArrayList.get(ArrayList.java:382) at com.ibm.jbatch.container.impl.PartitionedStepControllerImpl.executeAndWaitForCompletion(PartitionedStepControllerImpl.java:385)

Environment

3.5.0-24-generic #37-Ubuntu SMP Thu Feb 7 01:50:30 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Affected Versions

[4.0_dev]

glassfishrobot commented 6 years ago
glassfishrobot commented 11 years ago

@glassfishrobot Commented blankema said: I have a test project (maven based) and a patch file but could not find where to upload it.

If needed, just contact me.

glassfishrobot commented 11 years ago

@glassfishrobot Commented shreedhar_ganapathy said: -> Mahesh for eval on Batch RI.

glassfishrobot commented 11 years ago

@glassfishrobot Commented mk111283 said: Just wanted to add that currently (RC1) GlassFish is using only b23 batch jars. Anyways, Scott can comment on this more

glassfishrobot commented 11 years ago

@glassfishrobot Commented scottkurz said: This is a bug. As we didn't test @threads in the TCK we ended up not testing it at all. I will fix in the next drop.

glassfishrobot commented 11 years ago

@glassfishrobot Commented scottkurz said: Actually there's another bug here where we're neglecting to even honor the @threads attribute. I'm guessing this is the patch file mentioned since without this fixed I can't see how you could have created this in the first place. If you want to send it in case there's something else I missed.. you can send to ScottKurz@java.net, but I think I have this fixed now. Thanks for identifying this...

BTW, Mahesh... I think this is b25. The 84 driver was supposed to have been built on 10 Apr 2013 ... and we delivered b25 on 4/9.

glassfishrobot commented 11 years ago

@glassfishrobot Commented mk111283 said:

glassfishrobot commented 11 years ago

@glassfishrobot Commented tmueller said: Approved for 4.0, but in the future please fill out the change control template.

glassfishrobot commented 11 years ago

@glassfishrobot Commented scottkurz said: Just confirming that this is indeed fixed in 1.0-b26.

glassfishrobot commented 11 years ago

@glassfishrobot Commented mk111283 said: Resolved in b26 jars.

Svn commit info

svn commit -m "Integrate b26 jars. Fix for 20335, 20264. QL and batch devtests passed. Approved by Tom" Sending appserver/pom.xml Transmitting file data .... Committed revision 61563.

glassfishrobot commented 11 years ago

@glassfishrobot Commented Was assigned to mk111283

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA GLASSFISH-20335

glassfishrobot commented 11 years ago

@glassfishrobot Commented Reported by blankema

glassfishrobot commented 11 years ago

@glassfishrobot Commented Marked as fixed on Friday, April 19th 2013, 10:28:56 am