Skip to content

Commit

Permalink
fix a race condition.
Browse files Browse the repository at this point in the history
  • Loading branch information
jvshahid committed Nov 1, 2013
1 parent 559e7ed commit 9ef4b61
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/coordinator/coordinator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type CoordinatorSuite struct{}
var _ = Suite(&CoordinatorSuite{})

func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
runtime.GOMAXPROCS(runtime.NumCPU() * 2)
}

const (
Expand Down
4 changes: 2 additions & 2 deletions src/coordinator/raft_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,11 @@ func (s *RaftServer) ListenAndServe(potentialLeaders []string, retryUntilJoin bo
}

func (s *RaftServer) Serve(l net.Listener, potentialLeaders []string, retryUntilJoin bool) error {
go s.startRaft(potentialLeaders, retryUntilJoin)

s.port = l.Addr().(*net.TCPAddr).Port
s.listener = l

go s.startRaft(potentialLeaders, retryUntilJoin)

log.Println("Initializing Raft HTTP server")

// Initialize and start HTTP server.
Expand Down

0 comments on commit 9ef4b61

Please sign in to comment.