Commit Graph

257 Commits

Author SHA1 Message Date
John Ku
1c4b8aa000 Export pool.clients for custom Pool instantiation 2015-12-10 13:54:48 -08:00
John Ku
d20c3c7bd1 Allow custom Pool without constructor 2015-12-10 11:19:04 -08:00
Xing Xing
c6c6c9cac2 don't use sigillum 2015-07-10 20:30:35 +08:00
Xing
503d523dbf Merge pull request #60 from micmac/master
Replace mutex in client.do() with a channel to avoid deadlock and int…
2015-07-10 20:24:16 +08:00
Endre Hirling
c615e74af8 Replace mutex in client.do() with a channel to avoid deadlock and introduce command timeout 2015-07-06 21:40:49 +02:00
Xing Xing
df1af4f8cb 80 chars/line 2015-01-20 10:28:36 +08:00
Xing Xing
b612b80f80 complete the list of contributors 2015-01-20 10:27:12 +08:00
Xing Xing
2c9d82830c merge, update README to the newest API design. 2015-01-20 09:43:54 +08:00
C.R. Kirkwood-Watts
37db439a4a Update README.md
Updated to reflect new type names.
2015-01-19 10:28:21 -08:00
Xing Xing
bc80b2f853 fixed signal method 2015-01-16 17:41:19 +08:00
Xing Xing
939189448e golib/signal upgrade 2015-01-15 10:28:21 +08:00
Xing Xing
9dbb3ea3fc added lock-write to co-ordinate package sequence #56 2015-01-15 10:26:53 +08:00
Xing Xing
c01a2e22c0 upgrade travis to Go 1.4 2015-01-10 00:09:38 +08:00
Xing Xing
ad9b3cb988 go fmt 2015-01-06 11:45:18 +08:00
Xing Xing
a003eac543 fixed the closing method 2015-01-06 11:34:39 +08:00
Xing Xing
d32eb195e1 Merge branch 'kdar-big-data' 2014-12-10 09:14:08 +08:00
Xing Xing
25735c8488 merge for issue #33 2014-12-10 09:13:49 +08:00
Xing
ea92c122a5 Merge pull request #50 from AzuraMeta/patch-1
Fixed WORK_FAIL needing 2 arguments
2014-08-21 16:32:24 +08:00
Gabriel Cristian Alecu
e005ea4442 Fixed WORK_FAIL needing 2 arguments
According to http://gearman.org/protocol/ , WORK_FAIL only has 1 argument: the handle
2014-08-21 10:41:23 +03:00
Xing
9387a36a0b Merge pull request #49 from gbarr/write-errors
Do not ignore write errors
2014-08-21 09:24:18 +08:00
Graham Barr
7bcc4de76f Do not ignore write errors 2014-08-20 11:27:32 -05:00
Xing
ccb6f4a24f Merge pull request #48 from gbarr/large-packet-read
Avoid read channel corruption when response size > bufferSize
2014-08-19 17:11:42 +08:00
Graham Barr
d82da8fd71 Avoid read channel corruption when response size > bufferSize
When receiving a response, what was happening

1. Read bufferSize and it gets assigned to leftdata
2. Read another bufferSize
3. 2 buffers get appended, but leftdata still points to first buffer
4. Process data buffer which contains only complete responses
5. Back to ReadLoop, but leftdata still points to first incomplete buffer
    causing corrupt data to be processed

Solution is to make leftdata nil once we have merged it with the second buffer
2014-08-18 12:35:31 -05:00
Graham Barr
49ea8c0ec1 Increase buffer size to 8K 2014-08-18 09:51:33 -05:00
Xing
1f303d8145 Merge pull request #47 from gbarr/memleak
When a job completes, remove its handler
2014-07-25 09:46:21 +08:00
Graham Barr
3e556edb2d When a job completes, remove its handler 2014-07-24 14:20:56 -05:00
Xing Xing
d40888817d Merge branch 'master' into 0.2-dev 2014-06-16 11:00:20 +08:00
Xing
dde0c3e9b3 Merge pull request #45 from draxil/worker_disconnect_testing
Allow reconnect from error handler
2014-06-16 10:58:57 +08:00
Xing Xing
14f4df8ede Joe helped us greatly 2014-06-13 10:55:32 +08:00
Xing Xing
c8d59ea348 Merge branch 'master' into 0.2-dev 2014-06-13 10:51:48 +08:00
Xing
c6c0d4f481 Merge pull request #43 from draxil/master
Handling disconnects
2014-06-13 10:25:57 +08:00
Joe Higton
97731e1774 FIX: EOF disconnect error also called raw handler afterwards 2014-06-10 04:09:27 +01:00
Joe Higton
09c626f488 Cope with io.EOF as a disconnect error 2014-06-10 03:46:21 +01:00
Joe Higton
1ebb3d5fcc Wrap disconnect errors and allow reconnect 2014-06-10 03:23:18 +01:00
Joe Higton
6cf2680431 Merge branch 'worker_disconnect_testing' 2014-06-07 07:26:41 +01:00
Joe Higton
99bcf11768 FIX: The error handler is not called on disconnect
Using the disconnect test showed the agent was silently closing on disconnect
2014-06-07 07:22:40 +01:00
Joe Higton
827cf3fa3e Removed old gearman from travis
gearman-go and original gearmand don't play well, possibly an issue?
2014-06-07 06:36:24 +01:00
Joe Higton
7ddad76b85 Early stab at disconnect handling test 2014-06-07 06:14:28 +01:00
Joe Higton
e0614657e0 Added the original gearmand to travis for testing:
1. It's easier to test with (it installs in the regular path), we need to start and stop it for network error tests
2. Can't hurt to test with both implementations!
2014-06-07 05:50:58 +01:00
Joe Higton
912db95c0a FIX: waiting for worker fireup was making the test slow
Dodging the race condition with a sleep was fine, but we slept
for a whole second which was longer than this test takes to run!

I've scaled the sleep down to 250 miliseconds and increased the tries.

Even this is probably excessively long but now the test is fast agin.
2014-06-07 05:38:08 +01:00
Joe Higton
2f72b28d76 FIX: waiting for worker fireup was making the test slow
Dodging the race condition with a sleep was fine, but we slept
for a whole second which was longer than this test takes to run!

I've scaled the sleep down to 250 miliseconds and increased the tries.

Even this is probably excessively long but now the test is fast agin.
2014-06-07 05:35:05 +01:00
Xing
320155c608 Merge pull request #41 from draxil/master
Better Work() without Ready() behaviour, now with improved tests!
2014-06-05 11:42:37 +08:00
Joe Higton
0a4489d1fe Fixed and improved Work() without Ready() test:
* FIX: committed test froze
* FIX: committed test had a race condition!
* Added properly handled panic test
* Timeouts so that these tests should fail now if something goes wrong instead of failing.
2014-06-04 13:31:25 +01:00
draxil
6688c29c37 Enahanced Work() without Ready() behaviour:
Now if you try to call Work() without calling Ready(), it will trigger an attempt to run Ready(), and will only panic if there is an error.
2014-06-01 16:59:57 +01:00
Xing
3232b11d83 Merge pull request #38 from draxil/master
More helpful panic if you call Work() before you call Ready()
2014-06-01 22:13:35 +08:00
Joe Higton
24e93b4a2c More helpful panic if you call Work() before you call Ready() 2014-05-29 15:35:27 +01:00
Xing
e9ce09b885 Merge pull request #36 from rlmcpherson/master
Make pool clients safe for concurrent access with mutex.
2014-05-21 10:03:32 +08:00
Randall McPherson
0591572d8e Make pool clients safe for concurrent access with mutex. 2014-05-16 10:23:44 -04:00
Xing Xing
6910d548be added Kevin to the contributors list 2014-03-11 10:08:20 +08:00
Xing Xing
5334b50533 fixed #34 2014-03-11 10:03:00 +08:00