Skip to content

Commit

Permalink
FIX: temporary work around for zeromq/gomq#75
Browse files Browse the repository at this point in the history
  • Loading branch information
myzhan committed Nov 13, 2018
1 parent fd2f1de commit 602ade1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions client_gomq.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"fmt"
"log"
"net"
"os"
"runtime/debug"
"strings"

"github.com/zeromq/gomq"
Expand Down Expand Up @@ -82,6 +84,16 @@ func newZmqClient(masterHost string, masterPort int) *gomqSocketClient {
}

func (c *gomqSocketClient) recv() {
defer func() {
// Temporary work around for https://github.com/zeromq/gomq/issues/75
err := recover()
if err != nil {
log.Printf("%v\n", err)
debug.PrintStack()
log.Printf("The underlying socket connected to master(%s:%d) may be broken, please restart both locust and boomer\n", masterHost, masterPort+1)
os.Exit(1)
}
}()
for {
msg, err := c.pullSocket.Recv()
if err != nil {
Expand Down

0 comments on commit 602ade1

Please sign in to comment.