Skip to content

Commit

Permalink
move logging after acquiring lock
Browse files Browse the repository at this point in the history
  • Loading branch information
sakoush committed Oct 31, 2024
1 parent 213a341 commit bcd2fd5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion scheduler/pkg/agent/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ func (s *Server) ModelScalingTrigger(stream pb.AgentService_ModelScalingTriggerS

func (s *Server) Subscribe(request *pb.AgentSubscribeRequest, stream pb.AgentService_SubscribeServer) error {
logger := s.logger.WithField("func", "Subscribe")
logger.Infof("Received subscribe request from %s:%d", request.ServerName, request.ReplicaIdx)
key := ServerKey{serverName: request.ServerName, replicaIdx: request.ReplicaIdx}

// this is forcing a serial order per agent (serverName, replicaIdx)
Expand All @@ -394,6 +393,8 @@ func (s *Server) Subscribe(request *pb.AgentSubscribeRequest, stream pb.AgentSer
mu.(*sync.Mutex).Lock()
defer mu.(*sync.Mutex).Unlock()

logger.Infof("Received subscribe request from %s:%d", request.ServerName, request.ReplicaIdx)

Check failure on line 397 in scheduler/pkg/agent/server.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/seldonio/seldon-core) -s prefix(github.com/seldonio/seldon-core/scheduler) (gci)
fin := make(chan bool)

s.mutex.Lock()
Expand Down
3 changes: 2 additions & 1 deletion scheduler/pkg/kafka/dataflow/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ func (c *ChainerServer) PipelineUpdateEvent(ctx context.Context, message *chaine

func (c *ChainerServer) SubscribePipelineUpdates(req *chainer.PipelineSubscriptionRequest, stream chainer.Chainer_SubscribePipelineUpdatesServer) error {
logger := c.logger.WithField("func", "SubscribePipelineStatus")
logger.Infof("Received subscribe request from %s", req.GetName())

key := req.GetName()
// this is forcing a serial order per dataflow-engine
Expand All @@ -136,6 +135,8 @@ func (c *ChainerServer) SubscribePipelineUpdates(req *chainer.PipelineSubscripti
mu.(*sync.Mutex).Lock()
defer mu.(*sync.Mutex).Unlock()

logger.Infof("Received subscribe request from %s", req.GetName())

fin := make(chan bool)

c.mu.Lock()
Expand Down

0 comments on commit bcd2fd5

Please sign in to comment.