in src/main/java/com/amazonaws/codepipeline/jobworker/CodePipelineJobPoller.java [69:86]
public void execute() {
LOGGER.debug("New polling iteration");
final int batchSize = pollBatchSize - executorService.getActiveCount();
if (batchSize > 0) {
final int pollingBatchSize = Math.min(batchSize, pollBatchSize);
LOGGER.debug("PollForJobs with batch size: " + pollingBatchSize);
final List<WorkItem> workItems = jobService.pollForJobs(pollingBatchSize);
for (final WorkItem workItem : workItems) {
try {
executorService.submit(newProcessWorkItemRunnable(workItem));
} catch (final RejectedExecutionException e) {
LOGGER.error("Executor service rejected task scheduling", e);
}
}
}
}