Skip Menu |

This queue is for tickets about the TheSchwartz CPAN distribution.

Report information
The Basics
Id: 72815
Status: resolved
Priority: 0/
Queue: TheSchwartz

Owner: Jeff.Fearn [...]
Requestors: gerv [...]

Bug Information
Severity: Important
Broken in: 1.07
Fixed in: 1.11

Subject: Priority seems not to work due to large batch size; make batch size configurable?
Download (untitled) / with headers
text/plain 894b
If I create three jobs, of priorities 9, 7 and 5, it executes them in the order 9, 5, 7. This is really not what is expected! The reason seems to be that the prioritization is done when a worker grabs a batch of jobs. The batch size is 50, so my (one) worker grabs all of them. The worker then shuffles (!) the jobs "to avoid contention between workers", and thereby destroying the priority ordering. The current system works when priority is a hint, and there are many workers and many, many, jobs, but not when you actually want jobs executed in priority order. Suggested solution: can we make the batch size configurable? Default it to 50, but let me set it to 1. Then, the prioritization would work fine, and the defaults would still be big-enterprise friendly. perl -v: 5.10.1 Linux mink 2.6.37-020637-generic #201101050908 SMP Wed Jan 5 10:17:13 UTC 2011 i686 GNU/Linux Ubuntu 10.10.
Hi, is "$TheSchwartz::FIND_JOB_BATCH_SIZE = 1;" not sufficient?
Download (untitled) / with headers
text/plain 383b
Added batch_size & set_batch_size methods to expose FIND_JOB_BATCH_SIZE. After this patch you have to use the "$TheSchwartz::FIND_JOB_BATCH_SIZE = 1;" approach before any clients are instantiated. After instantiation "$client->set_batch_size(1);" is the way to do it. You can pass batch_size to new. To bcd19e3..b83765d master -> master
A fix for this issue shipped in Version 1.11.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to