gavrila florin
fa71d7a37a
add support for own ids
преди 2 години
Paul Cameron
a8f0a04c3d
Fix two race conditions in client.Do
* Common race condition is fixed by identifying that Client.respHandler
can be completely removed since all respHandler operations (get, put
and invocation) can be moved into the Client.processLoop goroutine,
meaning that zero locking is required. This race condition resulted
in a deadlock that was resolved by the response timeout at the
end of client.Do, returning ErrLostConn
* Rare race condition is fixed by changing responseHandlerMap.get
to .getAndRemove. This race condition resulted in the innerHandler
for a new dtJobCreated assigned in client.Do overriding a stale older
dtJobCreated request, and the newer innerHandler being removed by an
older dtJobCreated in client.processLoop > client.handleInner. When
the newer dtJobCreated response was received, the handler for it had
already been deleted. This was resolved by the response timeout at the
end of client.Do, returning ErrLostConn
преди 3 години
CodeLingo Bot
133dd3716f
Fix function comments based on best practices from Effective Go
Signed-off-by: CodeLingo Bot <bot@codelingo.io>
преди 5 години
Md. Ashiquzzaman
d0e6ec4878
Fix Odd use of time.Duration ( #29 )
Ref - https://github.com/appscode/g2/issues/28
преди 7 години
Sadlil Rhythom
f2f0349d2d
Remove lastcall.
преди 7 години
Christoffer Fjellström
0ca6dc2c6f
Remove duplicate locking
Fixes duplicated code after merge
преди 6 години
Christoffer Fjellström
99d317427f
Add skipping for integration tests when running unit tests
Run integration tests with the -integration flag
преди 6 години
Christoffer Fjellström
2dbf199260
Add lock on job handler assignment
Fixes race condition on jobs being done before handler is set.
преди 6 години
John-Lin
e1224a8c20
fixed typo and keep WorkComplate for downward compatibility
преди 6 години
Christoffer Fjellström
27942f55cd
Add sync lock on do() to avoid race conditions when creating jobs
преди 7 години
Christoffer Fjellström
d6791e2e42
Add sync lock to create job functions
Add sync lock to make create job calls thread safe.
преди 7 години
JessonChan
dd82e211a3
concurrent map bug fixed
преди 8 години
John Ku
9d99accce2
Allow built in selectionHandlers to be reused outside of package
преди 8 години
John Ku
1c4b8aa000
Export pool.clients for custom Pool instantiation
преди 8 години
John Ku
d20c3c7bd1
Allow custom Pool without constructor
преди 8 години
Xing Xing
c6c6c9cac2
don't use sigillum
преди 9 години
Endre Hirling
c615e74af8
Replace mutex in client.do() with a channel to avoid deadlock and introduce command timeout
преди 9 години
Gabriel Cristian Alecu
e005ea4442
Fixed WORK_FAIL needing 2 arguments
According to http://gearman.org/protocol/ , WORK_FAIL only has 1 argument: the handle
преди 9 години
Graham Barr
7bcc4de76f
Do not ignore write errors
преди 9 години
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
преди 10 години
Graham Barr
49ea8c0ec1
Increase buffer size to 8K
преди 10 години
Graham Barr
3e556edb2d
When a job completes, remove its handler
преди 10 години
Randall McPherson
0591572d8e
Make pool clients safe for concurrent access with mutex.
преди 10 години
Xing Xing
5334b50533
fixed #34
преди 10 години
Damian Gryski
7229235a4f
Use %v instead of %V, which is not a valid Printf verb
преди 10 години
Damian Gryski
ad0d49dcb2
Use fmt.Errorf() instead of errors.New(fmt.Sprintf())
преди 10 години
Xing Xing
f880354a61
type assertion with *net.OpError
преди 10 години
Xing Xing
45a9d7c3e5
fixed #31
преди 10 години
Xing Xing
98a935207b
fixed issue #27
преди 10 години
Xing Xing
87631cc2e5
go fmt & better examples
преди 10 години
Xing Xing
76196899f8
fxied issue #20
преди 10 години
Xing Xing
bf25cc1728
a better documents for the client package
преди 10 години
Xing Xing
02e6bfebcb
prepared for documentation
преди 10 години
Xing Xing
e9c29799fb
refactoring worker side data package
преди 10 години
Xing Xing
c8f2f5085c
race is bad, how should we do?
преди 10 години
Xing Xing
e3f789bc86
fixed nil pointer
преди 10 години
Xing Xing
e5179e3b5b
started refactoring worker
преди 10 години
Xing Xing
124e686699
go fmt
преди 10 години
Xing Xing
2a27eca7b7
fixed building package issue
преди 10 години
Xing Xing
358c8c4af0
processed ERROR package
преди 10 години
Xing Xing
4997e30a77
runabled 0.2
преди 10 години
Xing Xing
e5c30068cd
0.2 refactoring begining
преди 10 години
Paul Mach
5e215b9257
Remove depenance on external libs for unique id
преди 10 години
Xing Xing
2002bb1804
fixed bson/ObjectId
преди 11 години
mikespook
e7d32edee0
fixed for travis-ci
преди 11 години
mikespook
8e009be940
#14 fixed
преди 11 години
Paul Mach
f3b4013e2b
Update and Receive status correctly
преди 11 години
Xing Xing
011c3253f7
issue 'use of closed network connection' of client fixed
преди 11 години
mikespook
568c70b083
#12 fixed
преди 11 години
mikespook
7a8a5d4a6a
for issue #10 ; an IdGenerator interface, use bson.ObjectId as default
преди 11 години