Skip to content

Commit

Permalink
stop tssProcess only once in coordinator.execute function;
Browse files Browse the repository at this point in the history
Signed-off-by: tcar <[email protected]>
  • Loading branch information
tcar121293 committed Apr 30, 2024
1 parent fdfa27f commit 72f9d5b
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion tss/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ func (c *Coordinator) Execute(ctx context.Context, tssProcess TssProcess, result
c.processLock.Lock()
c.pendingProcesses[sessionID] = false
c.processLock.Unlock()
tssProcess.Stop()
}()

coordinatorElector := c.electorFactory.CoordinatorElector(sessionID, elector.Static)
Expand All @@ -111,7 +112,6 @@ func (c *Coordinator) Execute(ctx context.Context, tssProcess TssProcess, result
}

if !tssProcess.Retryable() {
tssProcess.Stop()
return err
}

Expand Down
1 change: 0 additions & 1 deletion tss/keygen/keygen.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ func (k *Keygen) Run(

k.Log.Info().Msgf("Started keygen process")

defer k.Stop()
p := pool.New().WithContext(ctx).WithCancelOnError()
p.Go(func(ctx context.Context) error { return k.ProcessOutboundMessages(ctx, outChn, comm.TssKeyGenMsg) })
p.Go(func(ctx context.Context) error { return k.ProcessInboundMessages(ctx, msgChn) })
Expand Down
1 change: 0 additions & 1 deletion tss/resharing/resharing.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ func (r *Resharing) Run(
return err
}

defer r.Stop()
p := pool.New().WithContext(ctx).WithCancelOnError()
p.Go(func(ctx context.Context) error { return r.ProcessOutboundMessages(ctx, outChn, comm.TssReshareMsg) })
p.Go(func(ctx context.Context) error { return r.ProcessInboundMessages(ctx, msgChn) })
Expand Down
1 change: 0 additions & 1 deletion tss/signing/signing.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ func (s *Signing) Run(
msgChn := make(chan *comm.WrappedMessage)
s.subscriptionID = s.Communication.Subscribe(s.SessionID(), comm.TssKeySignMsg, msgChn)

defer s.Stop()
p := pool.New().WithContext(ctx).WithCancelOnError()
p.Go(func(ctx context.Context) error { return s.ProcessOutboundMessages(ctx, outChn, comm.TssKeySignMsg) })
p.Go(func(ctx context.Context) error { return s.ProcessInboundMessages(ctx, msgChn) })
Expand Down

0 comments on commit 72f9d5b

Please sign in to comment.