mikespook/gearman-go — pull request #9 by nightlyone (2013-02-18 19:14:30+00:00)
Title: do not generate unique id on background job submission

Hi Xing Xing,

the gearman protocol doesn't require unique ids and the client library doesn't use them.
The implemenation using an autoincrement is also problematic with submitting background jobs in chunks with multiple invocations of a job submission binary.

I went the easiest way of just removing the unique id for background job submission. This is actually fine according to http://gearman.org/protocol (in the example protocol session)

The problem with uniqe ids and background jobs looks like this:
- I have a submission binary submitting fully verified jobs to gearman, but not waiting for the result.
- Another worker binary is listening for these jobs

When I call the submission binary in a loop, I get duplicate gearman job ids and only the first job is processed by the worker.

The submitter can not detect this failed submission, so avoiding it seems sane.

Another possible fix is to use uuids instead of autoinc, but I guess you used autoinc for good reasons :-)

Please merge.

Cheers
Ingo