@@ -35,7 +35,6 @@ import (
35
35
commonpb "go.temporal.io/api/common/v1"
36
36
"go.temporal.io/api/enums/v1"
37
37
"go.temporal.io/api/serviceerror"
38
- "go.uber.org/multierr"
39
38
"golang.org/x/exp/maps"
40
39
41
40
"go.temporal.io/server/api/adminservice/v1"
@@ -1444,7 +1443,8 @@ func (s *ContextImpl) handleReadError(err error) error {
1444
1443
case * persistence.ShardOwnershipLostError :
1445
1444
// Shard is stolen, trigger shutdown of history engine.
1446
1445
// Handling of max read level doesn't matter here.
1447
- return multierr .Combine (err , s .transition (contextRequestStop {}))
1446
+ _ = s .transition (contextRequestStop {})
1447
+ return err
1448
1448
1449
1449
default :
1450
1450
return err
@@ -1478,7 +1478,8 @@ func (s *ContextImpl) handleWriteErrorAndUpdateMaxReadLevelLocked(err error, new
1478
1478
case * persistence.ShardOwnershipLostError :
1479
1479
// Shard is stolen, trigger shutdown of history engine.
1480
1480
// Handling of max read level doesn't matter here.
1481
- return multierr .Combine (err , s .transition (contextRequestStop {}))
1481
+ _ = s .transition (contextRequestStop {})
1482
+ return err
1482
1483
1483
1484
default :
1484
1485
// We have no idea if the write failed or will eventually make it to persistence. Try to re-acquire
@@ -1487,7 +1488,8 @@ func (s *ContextImpl) handleWriteErrorAndUpdateMaxReadLevelLocked(err error, new
1487
1488
// reliably check the outcome by performing a read. If we fail, we'll shut down the shard.
1488
1489
// Note that reacquiring the shard will cause the max read level to be updated
1489
1490
// to the new range (i.e. past newMaxReadLevel).
1490
- return multierr .Combine (err , s .transition (contextRequestLost {}))
1491
+ _ = s .transition (contextRequestLost {})
1492
+ return err
1491
1493
}
1492
1494
}
1493
1495
@@ -1510,24 +1512,18 @@ func (s *ContextImpl) createEngine() Engine {
1510
1512
1511
1513
// start should only be called by the controller.
1512
1514
func (s * ContextImpl ) start () {
1513
- if err := s .transition (contextRequestAcquire {}); err != nil {
1514
- s .contextTaggedLogger .Error ("Failed to start shard" , tag .Error (err ))
1515
- }
1515
+ _ = s .transition (contextRequestAcquire {})
1516
1516
}
1517
1517
1518
1518
func (s * ContextImpl ) Unload () {
1519
- if err := s .transition (contextRequestStop {}); err != nil {
1520
- s .contextTaggedLogger .Error ("Failed to unload shard" , tag .Error (err ))
1521
- }
1519
+ _ = s .transition (contextRequestStop {})
1522
1520
}
1523
1521
1524
1522
// finishStop should only be called by the controller.
1525
1523
func (s * ContextImpl ) finishStop () {
1526
1524
// After this returns, engineFuture.Set may not be called anymore, so if we don't get see
1527
1525
// an Engine here, we won't ever have one.
1528
- if err := s .transition (contextRequestFinishStop {}); err != nil {
1529
- s .contextTaggedLogger .Error ("Failed to stop shard" , tag .Error (err ))
1530
- }
1526
+ _ = s .transition (contextRequestFinishStop {})
1531
1527
1532
1528
// use a context that we know is cancelled so that this doesn't block
1533
1529
engine , _ := s .engineFuture .Get (s .lifecycleCtx )
@@ -2032,9 +2028,7 @@ func (s *ContextImpl) acquireShard() {
2032
2028
2033
2029
// On any error, initiate shutting down the shard. If we already changed state
2034
2030
// because we got a ShardOwnershipLostError, this won't do anything.
2035
- if err := s .transition (contextRequestStop {}); err != nil {
2036
- s .contextTaggedLogger .Error ("Error stopping shard" , tag .Error (err ))
2037
- }
2031
+ _ = s .transition (contextRequestStop {})
2038
2032
}
2039
2033
}
2040
2034
0 commit comments