mikespook / gearman-go

This package is a Gearman API for Golang. It was implemented a native protocol for both worker and client API.
MIT License
291 stars 83 forks source link

Race condition when creating new job from client #76

Closed No-ops closed 7 years ago

No-ops commented 7 years ago

When creating several new jobs in parallel the client.innerhandler["c"] will be overwritten in client/client.go:225 which down the line leads to jobs getting results of the wrong job.

Proposed solution is to lock the do function only allowing one job to be set up at a time. Pull request: #75

No-ops commented 7 years ago

Fixed in 9735b2e54fa92ae6e45a0935a583f3ef425edcf9