Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions manager/dispatcher/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -1143,11 +1143,8 @@ func (d *Dispatcher) Heartbeat(ctx context.Context, r *api.HeartbeatRequest) (*a
d.rpcRW.RLock()
defer d.rpcRW.RUnlock()

// Its OK to call isRunning() here instead of isRunningLocked()
// because of the rpcRW readlock above.
// TODO(anshul) other uses of isRunningLocked() can probably
// also be removed.
if !d.isRunning() {
// TODO(anshul) Explore if its possible to check context here without locking.
if _, err := d.isRunningLocked(); err != nil {
return nil, status.Errorf(codes.Aborted, "dispatcher is stopped")
}

Expand Down