Skip to content
This repository has been archived by the owner on Jun 5, 2021. It is now read-only.

Commit

Permalink
client: don't use concurrency in agent.start
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Aug 11, 2018
1 parent ee6a265 commit 66fcc03
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@ func (s *callbackWaitHandler) setCallback(f func(event Event)) {
func (s *callbackWaitHandler) reset() {
s.processed = false
s.callback = nil
s.handler = nil
}

var callbackWaitHandlerPool = sync.Pool{
Expand Down
5 changes: 3 additions & 2 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -712,12 +712,12 @@ func TestClientRetransmission(t *testing.T) {
agent.start = func(id [TransactionIDSize]byte, deadline time.Time) error {
if attempt == 0 {
attempt++
go agent.h(Event{
agent.h(Event{
TransactionID: id,
Error: ErrTransactionTimeOut,
})
} else {
go agent.h(Event{
agent.h(Event{
TransactionID: id,
Message: response,
})
Expand All @@ -733,6 +733,7 @@ func TestClientRetransmission(t *testing.T) {
if err != nil {
t.Fatal(err)
}
c.SetRTO(time.Second)
go func() {
buf := make([]byte, 1500)
readN, readErr := connL.Read(buf)
Expand Down

0 comments on commit 66fcc03

Please sign in to comment.