Skip to content

Commit

Permalink
bridge: remove all supervisor.SignalHealthy calls
Browse files Browse the repository at this point in the history
Supervisor does not back off tasks that failed in a healthy state.

There are a couple places where we rely on supervisor for
application-level backoff, so we always want back-off. The distinction
is meant to enable runnables to implement their own specific back-off
logic, which we don't, so we can safely ignore it.

Fixes #37

ghstack-source-id: c756381b1b1598305ae6d59b2967ca7ea35aa68f
Pull Request resolved: #64
  • Loading branch information
Leo committed Oct 28, 2020
1 parent 8be34ac commit fd27570
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 10 deletions.
1 change: 0 additions & 1 deletion bridge/cmd/guardiand/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ func main() {
}

logger.Info("Started internal services")
supervisor.Signal(ctx, supervisor.SignalHealthy)

select {
case <-ctx.Done():
Expand Down
2 changes: 0 additions & 2 deletions bridge/cmd/guardiand/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ func p2p(obsvC chan *gossipv1.LockupObservation, sendC chan []byte) func(ctx con
}
}()

supervisor.Signal(ctx, supervisor.SignalHealthy)

for {
envl, err := sub.Next(ctx)
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletions bridge/pkg/ethereum/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,6 @@ func (e *EthBridgeWatcher) Run(ctx context.Context) error {
}
}()

supervisor.Signal(ctx, supervisor.SignalHealthy)

select {
case <-ctx.Done():
return ctx.Err()
Expand Down
2 changes: 0 additions & 2 deletions bridge/pkg/processor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ func NewProcessor(
func (p *Processor) Run(ctx context.Context) error {
ourAddr := crypto.PubkeyToAddress(p.gk.PublicKey)

supervisor.Signal(ctx, supervisor.SignalHealthy)

for {
select {
case <-ctx.Done():
Expand Down
4 changes: 1 addition & 3 deletions bridge/pkg/solana/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (e *SolanaBridgeWatcher) Run(ctx context.Context) error {
case codes.Internal:
// This VAA has already been executed on chain, successfully or not.
// TODO: dissect InstructionError in agent and convert this to the proper gRPC code
if strings.Contains(st.Message(), "custom program error: 0xb") { // AlreadyExists
if strings.Contains(st.Message(), "custom program error: 0xb") { // AlreadyExists
logger.Info("VAA already submitted on-chain, ignoring", zap.Error(err), zap.String("digest", h))
break
}
Expand All @@ -157,8 +157,6 @@ func (e *SolanaBridgeWatcher) Run(ctx context.Context) error {
}
}()

supervisor.Signal(ctx, supervisor.SignalHealthy)

select {
case <-ctx.Done():
return ctx.Err()
Expand Down

0 comments on commit fd27570

Please sign in to comment.